How to get url of a post from admin panel

You can get the ID of the post you’re editing like this: //currently edited post id $cep_id = $_GET[‘post’]; //permalink get_permalink( $cep_id ); This is and can only work if your editing an existing/saved post. It won’t and can’t work on »Add New«-Pages, because the post you’re going to add isn’t saved to the database … Read more

How to hook wp_list_pages?

A quick Google Search came up with this Source Try the following: function wp_list_pages_filter($output) { // modify $output here, it’s a string of <li>’s by the looks of source return $output; } add_filter(‘wp_list_pages’, ‘wp_list_pages_filter’);

How to disable all WordPress emails modularly and programatically?

Option 1: Remove the ‘to’ argument from wp_mail function in WordPress, it will keep your system running without sending any default WordPress emails. add_filter(‘wp_mail’,’disabling_emails’, 10,1); function disabling_emails( $args ){ unset ( $args[‘to’] ); return $args; } The wp_mail is a wrapper for the phpmailer class and it will not send any emails if there is … Read more

How to remove items from +New admin menu?

To hide everything (menu and submenu)- function wpse_260669_remove_new_content(){ global $wp_admin_bar; $wp_admin_bar->remove_menu( ‘new-content’ ); } add_action( ‘wp_before_admin_bar_render’, ‘wpse_260669_remove_new_content’ ); To hide specific menu/submenu item(s)- function wpse_260669_remove_new_content_items(){ global $wp_admin_bar; $wp_admin_bar->remove_menu( ‘new-post’ ); // hides post CPT $wp_admin_bar->remove_menu( ‘new-product’ ); // hides product CPT $wp_admin_bar->remove_menu( ‘new-page’ ); // hides page CPT $wp_admin_bar->remove_menu( ‘new-media’ ); // hides media } … Read more

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