Adding tables to dashboard pages programmatically?
Well in that case take a look at this tutorial on how to use the native WP_List_Table
Well in that case take a look at this tutorial on how to use the native WP_List_Table
Simply use the post ID, provided by $post_id (and stored at $post->ID) to use the various functions WordPress provides to get any extra data related to that post (get_the_terms,get_post_meta etc). Performance wise you suffer no loss by using these functions as opposed to trying to force more data into the $post object (probably the reverse … Read more
As of WordPress 3.0.0 this action is available at the top of the new user form: user_new_form_tag As of WordPress 3.7.0 this action is called at the end of the form (right before submit button): user_new_form You will however need to intercept when clicking submit to save any specific user information to the user’s meta
Go down the rabbit hole… http://core.trac.wordpress.org/browser/tags/3.3.2/wp-includes/functions.php#L306
No, this cannot work. Haven’t you tested your idea? A simple workaround would be a class: class WPSE_53453_Action_Handler { public $tokens, $payloads; public function process() { $tokens = $this->tokens; $payloads = $this->payloads; // do something awesome } } $WPSE_53453 = new WPSE_53453_Action_Handler; $WPSE_53453->tokens = array ( ‘foo’, ‘bar’ ); $WPSE_53453->payloads=”hello”; add_action( ‘publish_post’, array ( $WPSE_53453, … Read more
In response to the extended question, i.e. Another question is[…]: It is worth noting that WordPress’ plugin API does not persist between requests – that is to say, any functions associated with actions through WordPress’ add_action() are only associated for the duration of the script’s execution. Each subsequent request served by WordPress must once again … Read more
The problem was with WP-Super-Cache plugin. When I was logged in, it wasn’t serving me a cached file, so my template redirect was being executed. Not sure if this is a known liability with WP-Super-Cache. My solution was to make a template for page-testimonials.php where I set up my PHP redirect. After flushing the cache, … Read more
Untested, but I’d start with something like this: add_action( ‘wp’, ‘your_function’, 3 ); function your_function(){ if ( is_page_template( ‘some-template.php’ ) ) { if( some condition ) locate_template( array( ‘some-other-template.php’ ), true ); else return; } else return; }
This would depend on the way the plugin was structured. If it is just procedural then your pretty much out of luck. If it is written within a class you can extend or create a new instance of it and override methods. As an example in my media tools plugin I use a portion of … Read more
functions attached to manage_pages_custom_column get fired for every custom column, you have to check the name of the column within the function to only output data for that specific column: add_action( ‘manage_pages_custom_column’, ‘AddColumnValue’, 10, 2 ); function AddColumnValue( $column_name, $post_id ) { if( ‘thumbnail’ == $column_name ): echo ‘Header Image data here’; elseif( ‘cssColor’ == … Read more