Add frontend “Restore” link

From your comment above, I believe you’re running into issues with the _wpnonce piece of the puzzle. Looking at the code in /wp-admin/post.php, it appears that the untrash instruction is checking for a valid WordPress nonce, and not getting one. This might do the trick: <?php function wpse_95348_undelete_post( $post_id ) { // no post? if( … Read more

How to use Yoast SEO backend in english even if WPLANG variable is not english?

That plugin loads its language the moment its main file is included: load_plugin_textdomain( ‘wordpress-seo’, false, dirname( plugin_basename( __FILE__ ) ) . ‘/languages’ ); So when your locale filter is used, the language is already there. :/ Move your small plugin into the mu-plugins directory. You can create it if it doesn’t exists in wp-content. That … Read more

Built-in data validation function for URLs

Use esc_url( $url ) for URLs that should be displayed and esc_url_raw( $url ) if the URL should be sent to the database. The first will replace bare ampersands & with &#038;. The second is a wrapper for the first; it will just suppress the escaping of ampersands. Both functions will check the protocol. See … Read more

Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end

This will allow you to access post.php and still restrict the back-end. You need have action, action name as delete, post key and value, and wpnonce kay and value. Otherwise, it will redirect you to homepage. function disable_wp_admin() { if ( ! is_admin() ) return; if ( current_user_can( ‘manage_options’ ) ) return; if (( current_user_can( … Read more

Front-end update_post_meta with ajax

You should check out this document on WordPress.org: http://codex.wordpress.org/AJAX_in_Plugins It gives you everything you need to create front-facing XHR functionality. Make sure to set a nopriv hook for those who aren’t logged in. http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Viewer-Facing_Side Also the JS variable ajaxurl is only set on the backend. You will need to define that yourself on the front-end. … Read more

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