How to check which submission button was clicked?

The function submit_button() does generate: <input type=”submit” name=”submit” id=”submit” class=”button button-primary” value=”Save Changes” /> As seen on the codex documentation page. Which gives you the possibility to check for a $_POST or, depending on the form, $_GET or generic $_REQUEST variable – to be exact for $_POST[ ‘submit’ ] or $_GET[ ‘submit’ ] or $_REQUEST[ … Read more

wp_editor customization

What you can do is use the get_current_screen() function to get what screen the current user is on ( in the admin panel ) and only add those global values whenever the user is viewing the post page: function my_format_TinyMCE( $in ) { $screen = get_current_screen(); if( is_object( $screen ) && ‘post’ == $screen->post_type ) … Read more

Custom button on custom taxonomy listing page

This action hook (found in /wp-admin/edit-tags.php) will output the button below the table (not quite where you have asked to position it, but it is an easily available action and outside the form table.) $taxonomy = ‘location’; // you will probably need to change this add_action(‘after-{$taxonomy}-table’,’custom_export_button’); function custom_export_button($taxonomy) { $export_url = admin_url(‘admin-ajax.php’).’?action=export_taxonomy’; echo “<form action='”.$export_url.”‘ … Read more

‘Conflict’ with action deleted_post and is_admin()

More importantly you should notice what link is produced by get_delete_post_link(). It’s an admin link is_admin() check will be always true. Instead you need something else that helps match the request. Try adding and query arg to your delete link. add_query_arg( ‘origin’, ‘fe’, get_delete_post_link( get_the_ID() ) ); then in the action add_action(‘deleted_post’, ‘woffice_trashed_post_handler’, 10); function … Read more

Rewrite rule pagination on different url levels

I have added extra rewrite rules for pages with no item_width and item_height in combination with pagination as follows: /** * Adds rewrite rules for shop category */ function gtp_add_shop_rewrite_rules() { // shop-category/category/item_width/item_height/page/2/ add_rewrite_rule( ‘^shop-category\/([^/]*)\/([^/]*)\/([^/]*)\/page\/([0-9]*)$’, ‘index.php?shop-category=$matches[1]&item_width=$matches[2]&item_height=$matches[3]&paged=$matches[4]’, ‘top’ ); // shop-category/category/page/2/ add_rewrite_rule( ‘^shop-category\/([^/]*)\/page\/([0-9]*)$’, ‘index.php?shop-category=$matches[1]&paged=$matches[2]’, ‘top’ ); // /shop-category/category/item_width/item_height/ add_rewrite_rule( ‘^shop-category\/([^/]*)\/([^/]*)\/([^/]*)$’, ‘index.php?shop-category=$matches[1]&item_width=$matches[2]&item_height=$matches[3]’, ‘top’ ); // /shop-category/category/item_width/ add_rewrite_rule( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)