squarecandy
Forum Replies Created
-
added these to the $invalid array:
' '=>'-', '%20'=>'-'And changed line 91 to
$sanitized_filename = preg_replace('/[^a-zA-Z0-9-_\.]/', 'x', strtolower($sanitized_filename));This seems to produce much more useful results, even if filenames with a bunch of x’s look odd.
Forum: Plugins
In reply to: [Simple Google Calendar Widget] Does this use the new Google API v3?I’m working on a plugin that uses google calendar api v3, outputs HTML5 and has a bunch of options. I’ve uploaded to the plugin site… I’ll keep you posted about when they publish it. See here if you want to check it out right away. Would love to hear your feedback:
http://squarecandy.net/candycal_v3.zipForum: Hacks
In reply to: apply_filters the_content not triggering oembed even in the loopNice Adrian – thanks for identifying the issue – that was stumping me. Appears to be a problem with regular
the_content()too if you get something like<p style="text-align: justify;">https://www.youtube.com/watch?v=pWxnGf7isqc</p>in your html saved in the database.I found deleting and redoing the copy and paste on a single line in the editor now works.
Also, if you want to use the code above, there’s a small typo. Use:
str_replace(array('<p>','</p>'), '', $tabContent)Forum: Plugins
In reply to: [Simple Fields] Date Picker can't save blank valueOk – solved it:
field_date_v2.php, line 382:
function edit_save($values = null) { if ( empty($values["gui_selected_date"]) ) { return ""; } elseif ( is_array($values) && isset($values["saved_date_time"]) && !empty($values["saved_date_time"]) ) { return trim($values["saved_date_time"]); } else { return ""; } }Would be nice to add this to the next release…
Forum: Plugins
In reply to: [WooCommerce] Downloads are Accessible?This seems to be solved in the current version. The “Choose a file” button puts uploads straight into the woocommerce_upload folder and is properly protected.
Forum: Themes and Templates
In reply to: CSS Menu Puzzle: Horizontal menu, items L to R, but align menu ROh, awesome – thanks that worked. I really thought I tried that before, but I guess not or I was doing something wrong…
Yeah, I posted the jsfiddle because I’m working on the site locally and I wanted a solution I could implement in several different places/situations.
Anyways, thanks for your help alchymyth!
Forum: Plugins
In reply to: manage_posts_custom_column not workingUggg! Thanks for the tip iamfriendly… Was messing with that for a long time.
Do we know if this is something that should be reported as a bug, or if it works this way by design for some odd reason?
I’m still having the issue in 3.1.2
Forum: Fixing WordPress
In reply to: wp_nav_menu: List only 2nd level (separate submenu)?dantdr –
Sounds like you’re not quite in the right place w/ this thread.
Try rendering the whole menu with the regular wp_nav_menu function and then hiding what you don’t want to see w/ some CSS.ul.sub-menu {display:none;} li.current-menu-ancestor ul.sub-menu {display:block;}something like that.
Forum: Fixing WordPress
In reply to: wp_nav_menu: List only 2nd level (separate submenu)?Forum: Fixing WordPress
In reply to: wp_nav_menu: List only 2nd level (separate submenu)?Hey becskr –
I’ve got valid html with that code at the toomai link above. Do you have a link to your implementation?
I agree – it would be best to just have one level of unordered list rendered… but we’re hacking at the menu walker code that would normally show the top level and secondary menu items to just show the secondary level – so I’m not sure if/how that’s possible…
Forum: Fixing WordPress
In reply to: wp_nav_menu: List only 2nd level (separate submenu)?Dag – automated code-chunk removal – that’s new!
New Function here:
http://wordpress.pastebin.com/Jk7n20mBForum: Fixing WordPress
In reply to: wp_nav_menu: List only 2nd level (separate submenu)?UPDATE:
This version of the function fixes the missing<li>and integrates 5ulo’s bug fix.1) Put this in your functions.php file:
[Code moderated as per the Forum Rules. Please use the pastebin]
2) Put this in your theme file, like sidebar.php or wherever else you might want to put your submenu:
$menu_args = array( 'walker' => new Custom_Walker_Nav_Sub_Menu(), 'container' => '', 'menu_class' => 'sister-pages', ); wp_nav_menu($menu_args);3) Make sure you have some custom CSS to style it all up.
Also note that with the new menu system you can add multiple instances of a single page the the menu. That’s very handy – for example I’ve added a top level menu item “About” to this menu, and then added “About” again as its first subpage, but renamed the link “About the Quintet”.
http://toomaiquintet.com/bios/Fun times with menus!
Forum: Fixing WordPress
In reply to: wp_nav_menu: List only 2nd level (separate submenu)?This is so close to being perfect – check out my implementation of the above code here:
http://toomaiquintet.com/bios/Only one tiny little problem:
<ul id="menu-menu-1" class="sister-pages"> <ul class="sub-menu"> <li ... <li ... </ul> </li> </ul>Anyone know how to add
<li>after<ul id="menu-menu-1" class="sister-pages">using this custom walker code? Not a huge deal – it still works as is, but it would be nice to have proper HTML.Forum: Fixing WordPress
In reply to: wp_nav_menu: List only 2nd level (separate submenu)?I’m using sushicoder’s original solution, as posted by petersom3000, with nerdfactor’s revision to eliminate the parent item.
Works like a charm. THANK YOU to everyone who helped with this…Just to sum it all up:
1) Put this in your functions.php file:
[Code moderated as per the Forum Rules. Please use the pastebin]
Forum: Fixing WordPress
In reply to: How to get grandparent page in classes.php?awesome – thanks 2is3!
here’s my menu for the header – works nicely up to two levels of page depth (so children / grandchildren)
i’m sure there’s a more efficient way to do this – but this works.
<?php $current = $post->ID; $parent = $post->post_parent; $haschildren = wp_list_pages("depth=1&title_li=&child_of=".$current."&echo=0"); $grandparent_get = get_post($parent); $grandparent = $grandparent_get->post_parent; if ($grandparent != 0) { if ($grandparent) { $grandchildren = wp_list_pages("depth=1&title_li=&child_of=".$grandparent."&echo=0"); } else { $grandchildren = wp_list_pages("depth=1&title_li=&child_of=".$grandparent."&echo=0"); } if ($grandchildren && is_page()) { ?> <div class="submenu"> <ul class="submenuul"> <?php echo $grandchildren; ?> </ul> </div> <?php } } if ($parent) { $children = wp_list_pages("depth=1&title_li=&child_of=".$parent."&echo=0"); } else { $children = wp_list_pages("depth=1&title_li=&child_of=".$current."&echo=0"); } if ($children && is_page()) { ?> <div class="submenu"> <ul class="submenuul"> <?php echo $children; ?> </ul> </div> <?php } if ($haschildren != '' && $parent != '0' && $grandparent == '0') { $morechildren = wp_list_pages("depth=1&title_li=&child_of=".$current."&echo=0"); } if ($morechildren && is_page()) { ?> <div class="submenu"> <ul class="submenuul"> <?php echo $morechildren; ?> </ul> </div> <?php } ?>