Hide allow trackbacks/pingbacks

Method 1 (CSS) You can hide it for all non-admins via CSS: function hide_ping_track_wpse_103502() { if( get_post_type() === “post” ){ if( ! current_user_can( ‘manage_options’ ) ){ // only for non-admins echo “<style>.meta-options label[for=ping_status], #ping_status{display:none !important;} </style>”; } } } add_action( ‘admin_head-post.php’, ‘hide_ping_track_wpse_103502’ ); Before: After: Method 2 (PHP) You can also remove the native discussion … Read more

Conditional check for front-end which includes ajax

DOING_AJAX and WP_ADMIN (this constant is checked within is_admin() ) are defined in admin-ajax.php and set tro true. Both are not very helpfull in this situation. Add a parameter to your ajax request if the request come from the front-end: <?php function my_action_javascript() { ?> <script type=”text/javascript” > jQuery(document).ready(function($) { var data = { action: … Read more

WordPress – wp-admin subdomain

The folder location /wp-admin is hardcoded into wordpress in multiple locations. It is pretty problematic to modify the location. WordPress will always go to /wp-admin. There are ways around this, but their are many steps. You can forward a subdomain to www.mydomain.net/wp-admin but WordPress will still always go through www.mydomain.net/wp-admin. Here is a reference if … Read more

Remove post from new menu in top bar

The users can still create new posts if the URL is known, like; domain.com/wp-admin/post-new.php Here is the code you can use for that … added it to the file functions.php function hide_add_new() { global $submenu; // For Removing New Posts from Admin Menu unset($submenu[‘post-new.php?post_type=post’][10]); // For Removing New Pages unset($submenu[‘post-new.php?post_type=page’][10]); // For Removing CPTs unset($submenu[‘post-new.php?post_type=custom_post_type’][10]); … Read more

How do I set up a webhook?

You are using self-hosted WordPress, which sometimes referred to as WordPress.org. Calling remote hook is still a possibility there, but unless your e-commerce solution supports it, you may need to add a custom code. Option – find a plugin There are some plugins which will post data to external URL when certain event happens, say, … Read more

Custom WP_List_Table displays blank rows

You’re getting the blank rows because your column headers are registered late. And you should register the headers (i.e. initialize the list table class instance) before admin notices are rendered on the page, i.e. before WordPress fires hooks like admin_notices. But your customer_list_page() function, which I believe, is a callback for either add_menu_page() or add_submenu_page(), … Read more

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