Export User Info to CSV from Front End

Nevermind, I figured out a way to make it work. I just removed the need for a url altogether. Here’s what I did in case anybody else wants to know. I changed the link to an form input button: <form method=”post”> <input type=”submit” name=”bc_export” class=”btn btn-export” value=”Export Store List for ‘.$atts[‘value’].'” /> </form> And changed … Read more

Question about repurposing WordPress 404 handler

Here is the tested code, you can use it as a mu-plugin: <?php /** * Filters whether to short-circuit default header status handling. * * Returning a non-false value from the filter will short-circuit the handling * and return early. * * @param bool $preempt Whether to short-circuit default header status handling. Default false. * … Read more

WordPress will not operate correctly

You probably messed up with the config on the DB I would like the dump of the config table please, that way i can see the paths to your wp install (i had a similar problem which i solved by manually correcting the fields in DB) EDIT Run this sql query and let me know … Read more

Rewriting search and pagination base

there are 3 steps towards achieving your goal. 1 – Rewrite rules – wordpress needs to know what to look for and what to map it to add_rewrite_rule( ‘suche/([^/]+)/?$’, ‘index.php?s=$matches[1]’, ‘top’ ); add_rewrite_rule( ‘suche/([^/]+)(/seite/(\d+))/?$’, ‘index.php?s=$matches[1]&paged=$matches[3]’, ‘top’ ); The above adds straight rewrite rules to the rewrite rules array so anytime someone goes to a URL … Read more

Set a User as Author of all ‘New Posts’ posted

function wp84782_replace_author( $post_ID ) { $my_post = array(); $my_post[‘ID’] = $post_ID; $my_post[‘post_author’] = 1 ; //This is the ID number of whatever author you want to assign // Update the post into the database wp_update_post( $my_post ); } add_action( ‘publish_post’, ‘wp84782_replace_author’ ); Update: This hook runs as the post is being published, not after, so … Read more

Restrict access to post if it is currently being edited

The warning notice gets dispatched by the function wp_check_post_lock. The following redirects the user back to the post listing screen if someone else is editing it. add_action( ‘load-post.php’, ‘redirect_locked_post_wpse_95718’ ); function redirect_locked_post_wpse_95718() { if( isset($_GET[‘post’] ) && wp_check_post_lock( $_GET[‘post’] ) ) { global $typenow; $goto = ( ‘post’ == $typenow ) ? ” : “?post_type=$typenow”; … Read more

Best way to extends core classes in theme?

What you are doing will work, and is correct as far as the PHP goes. Whether it is a good idea or not really depends on what you are doing specifically and whether you can do it with hooks— actions and filters– instead. If you can do it with hooks you probably should but your … Read more