apply_filters to $GLOBALS

Assuming that $GLOBALS[‘Pootle_Page_Builder_Render_Layout’] carries an instance of Pootle_Page_Builder_Render_Layout, the method panels_render() returns a string. So you can simply pass the method call as an argument to apply_filters(): $content = apply_filters( ‘the_content’, $GLOBALS[‘Pootle_Page_Builder_Render_Layout’]->panels_render( $page_data->ID ) ); I’m not sure whether this is an intended use of the API of the plugin, as Pootle_Page_Builder_Render_Layout::panels_render() remove some default … Read more

global $post inside plugin query messes up every new post page in wp-admin

You have two problems in your code. You use $post as a iteration variable which is an habit best avoided You use setuppostdata which changes the global $post without you using any function that actually needs it your loop should look like foreach ( $pp_query as $p) : $pointer_query[] = array( ‘id’ => get_post_meta($p->ID, ‘_sbap_pointerid_text’, … Read more

Use a select box to change a php variable

To store the user defined value into the DB you can use the update_user_meta() function. And retrieve back the info with get_user_meta(). You could update the the user meta key with an AJAX call on your select change or put your select in a form and update on form submit either with $_GET or $_POST … Read more

global categories – Share specific categories in wordpress multisite

Here is a solution I found- // even before any taxonmy/terms are initialized, we reset the tables add_action( ‘init’, ‘the_dramatist_change_tax_terms_table’, 0 ); // on blog switching, we need to reset it again, so it does not use current blog’s tax/terms only // it works both on switch/restore blog add_action( ‘switch_blog’, ‘the_dramatist_change_tax_terms_table’, 0 ); function the_dramatist_change_tax_terms_table(){ … Read more