how to retrieve a value if a checkbox is checked

You need to first get the post meta value that Fieldmanager writes to your database for the checkbox. This answer can help you. Then you can properly set $in_update and do this test: elseif ( /* VALUE WHEN YOUR CHECKBOX IS CHECKED */ == $in_update ) { echo ‘<span class=”…’; }

Title Case WordPress Menu Items

See if the following might work for you, I posted about it yesterday in response to another question so played around with it today. Also see the point in the codex of inheriting from Walker_Nav_Menu instead. You can subsequently modify the output of the menu and use your function. Example from the codex: <?php class … Read more

Function to delete a post, it’s children and it’s grand children (half way there already)

Here’s what you can do: get all the ids of direct children get all ids of grand children combine trash function trash_redirection_frontend($post_id ) { if ( filter_input( INPUT_GET, ‘frontend’, FILTER_VALIDATE_BOOLEAN ) ) { $args = array( ‘posts_per_page’ => -1, ‘post_parent’ => $post_id, ‘post_type’ => ‘bucket’, ‘fields’ => ‘ids’, // get only the ids, it’s all … Read more

Changing the default object embed sizes?

This is what I crafted to override the defaults, I set a default media width, choose an aspect ratio (16:9) and then replace the video shortcode output. $defaultMediaWidth = 960; if ( ! isset( $content_width ) ) { $content_width = $defaultMediaWidth; } add_filter( ’embed_defaults’, ‘bigger_embed_size’); function bigger_embed_size() { global $content_width; $width = $content_width; // aspect … Read more

Populate editor with some content of a page with a page template

The is_page_template() function will not work in the admin. The second parameter of the default_content filter is the $post object. Your best bet is to leverage that to get the stored value for the page template in the post meta information: add_filter( ‘default_content’, ‘wpse_editor_default_content’, 10, 2 ); function wpse_editor_default_content( $content, $post ) { if ( … Read more