Tag Info

New answers tagged

0

Yet another reason this could be is that the "Edit" button in the front end of a post, is using a cdn's domain (caching the links but also switching the domains, causing cookie confusion and thus logging you out) rather than your own site. Some hosting providers offer link caching that intercept these admin links as well. You can test it by copying the ...


-2

use this code for solving your problem. <?php $args = array( 'orderby' =>'name', 'texonomy' =>'category', 'child_of' =>0, 'parent' =>0 ); $cats = get_categories($args); foreach ($cats as $cat) { echo $cat->name; $arg = array('orderby' => 'name', ...


0

EDIT: On a post page, the categories are already seen in hierarchical manner but with checkboxes. So, I have assumed that you have to show list of all the categories/subcategories somewhere in the admin panel in following format. Category 1 Sub-Category 1.1 Sub-Category 1.2 Category 2 So, presentation is upto you, I have just given logic to pull ...


1

Placing this answer for those people who're trying to fix the same issue. It's important where add_action('wp_ajax_setAsyncCheckProduct', [$this, 'setAsyncCheckProduct']); resides. In my case the issue was finally fixed moving a similar line to the main plugin file, where all concrete classes are included and initialised. Of course the line had to be ...


1

By passing the _builtin argument to get_post_types(), only WordPress default post types will be returned. Instead, just pass public as an arguement, Here's an example of output on a development site with WooCommerce activated: var_dump(get_post_types(['public' => true])); //result array(4) { ["post"]=> string(4) "post" ["page"]=> ...


0

Local development is an option, as others have pointed out. However, I personally prefer working online, so that I can immediately test real use cases. If your budget permits, you can set up a staging domain name. Here you can build the site as if you intended it to be live on that address. Using a combination of WordPress' privacy settings and a robots.txt ...


0

Of course you can. First you need to install a local server. Here are some choices: Wamp Xampp VVV USB Web Server Cloud9 After you create your website all you have to do is to transfer it to your new domain name. There are numerous backup plugins that can do the job. Here is an article that cover some of them. Of course you can migrate it yourself. Here ...


0

Try to look at .htaccess, check if there is something like this: <Files wp-login.php> AuthType Digest AuthName "blah" AuthUserFile /home/blah/.htpasswd Require valid-user </Files> Delete it and it should work


0

In the five years that this question has been here, nobody has addressed the core issue: Security by obscurity is a valid technique to ward off automated bots and keep the logs clean. The goal of moving/hiding wp-admin is to appear to a bot that this is not a WordPress site. The way that I hide (but not move) wp-admin is to present to bots the standard 404 ...


0

You can also use this : <?php if( current_user_can('editor') || current_user_can('administrator') ) { ?> // stuff here for admins or editors <?php } ?> For detailed reference check this another thread on stack. Thanks


0

Here's how we've done it, in order to change only a specific custom post type: /* edit the admin page title for a particular custom post type */ function edit_page_title() { global $post, $title, $action, $current_screen; if( isset( $current_screen->post_type ) && $current_screen->post_type == 'CUSTOM-POST-TYPE' && $action == ...


1

Actually your question is off-topic here, because it's javascripts specific and not specific to WordPress. But I'm answering it and making it more WordPress-centric so that others get help too. The following function will enqueue a custom.js file from your theme folder's /js subfolder to only admin panel (put it in functions.php of your theme): function ...


1

Use orderby=id You can simply sort the tags by term_id with the following GET request: /wp-admin/edit-tags.php?taxonomy=post_tag&orderby=id&order=desc and similar for other taxonomies. Why does this work? The orderby parameter is read through: if ( !empty( $_REQUEST['orderby'] ) ) $args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) ...


0

I was wondering the same thing. There's a modern version that uses admin_enqueue_scripts: add_action('admin_menu', function () { $settingsPage = add_options_page('Settings', 'Mortgage Calculator', 'manage_options', 'mortgagecalculator', function () { echo "<div id='app'></div>"; }); /** * Include the ember admin scripts only on ...


1

Search for add_meta_box(). This function is the key to add custom areas to the edit screen and inside this can you handle your custom requirements.


0

After trying everything, this worked for me: global $allowedposttags; $allowedposttags['div'] = array('align' => array (), 'class' => array (), 'id' => array (), 'dir' => array (), 'lang' => array(), 'style' => array (), 'xml:lang' => array() ); $allowedposttags['iframe'] = array('src' => array () ); ...


0

The hook to use here is admin_notices. However in register_activation_hook and register_deactivation_hook it shouldn't be used because these function run when plugin activates and deactivates instance. A workaround it we use add_option when plugin activates and delete_option when plugin deactivates. Here is the code. Hopefully you will understand it ...



Top 50 recent answers are included