Using wp_get_nav_menu_items() to list children of children pages

Well, I’m afraid I never did work out the code to this. What I did find is a pair of plugins that accomplish what I’m looking to do. List sub pages of the same level as the current sub page/child/grandchild page and then be able to exclude certain pages from showing up. http://wordpress.org/extend/plugins/child-page-navigation/ http://wordpress.org/extend/plugins/exclude-pages/ Might … Read more

Customizing subject in comment notification e-mails

If I understand you correctly you want to change the subject line of the email. The hook of your code only changes the content of the e-mail. There’s a different hook for the subject: add_filter(‘comment_notification_subject’, ‘wpse_228315_comment_notification_subject’); function wpse_228315_comment_notification_subject($subject, $comment_id){ return “New comment”; }

How to remove row-actions from pages table?

For non-hierarchical post types the filter is called post_row_actions, for hierarchical it’s page_row_actions. If you want to remove all actions you don’t have to unset the individual items, you can just return an empty array. add_filter( ‘page_row_actions’, ‘wpse16327_page_row_actions’, 10, 2 ); function wpse16327_page_row_actions( $actions, $post ) { if ( ‘page’ == $post->post_type ) { return … Read more

Keep one user logged for a year?

get_currentuserinfo() is a pluggable function, it is not available during plugins load stage. That aside you shouldn’t be adding filter conditionally, but use data provided by the filter. If you take a look at filter calls: apply_filters( ‘auth_cookie_expiration’, 14 * DAY_IN_SECONDS, $user_id, $remember ) $user_id is provided as second argument. You just have your filter … Read more

Pagination adding page-numbers dots when using ‘mid_size’ => 0

Here’s a workaround: First change the paginate_links() output type to: ‘type’ => ‘array’, Then we can collect the previous, current and next parts from the paginate_links() output. Here’s a simple example where we target the relevant classes: $next=””; $current=””; $prev = ”; foreach( (array) $paginate_links as $link ) { if( false !== strpos( $link, ‘prev … Read more

TinyMCE custom styles remove class when switching styles

Seems the question was asked at community.tinymce.com and the answer is here: https://community.tinymce.com/communityQuestion?id=90661000000IiyjAAC You can’t make the style you’ve defined remove any previous classes, but what you can do is ‘apply’ the style again by selecting it from the dropdown list and it will be removed – i.e. the class will be removed from the … Read more