accessing parent variables in child construct without executing action in parent

I think your problem is the pattern. You should not create a child class of your controller (the main class), and the controller should not handle action callbacks. Let the controller assign the callbacks to actions. The action handlers should be separate classes. Basic example: namespace WPSE; add_action( ‘plugins_loaded’, function() { new Controller; }); class … Read more

Conditional tag in Widget Logic for checking if top level page or if subpage

You can find the answer on the plugin’s page at wordpress.org. Select the tab ‘Other Notes’. You will find it at the example list: global $post; // WP page that is a child of page 77 return in_array(77, get_post_ancestors($post)); Edit: As an alternative to your suggestions you may try global $post; return !empty(get_post_ancestors($post)); This is … Read more

“Custom Post Type Permalinks” plugin URL strcuture

I managed to find a way to fix this by toying with my Custom Post Type and Taxonomy registrations. In register_post_type properties: ‘rewrite’ => array( ‘slug’ => ‘classes’ ), In register_taxonomy properties: ‘rewrite’ => array( ‘slug’ => ‘classes’, ‘with_front’=> false ), I now have a clean structure where http://site.com/classes/ points to the post type archive … Read more