Tag Info

New answers tagged

0

You can for example add this: foreach( array( 'tools', 'import', 'export' ) as $x ) { add_action( "load-{$x}.php", function() { if( ! current_user_can( 'manage_options' ) ) wp_die( __( 'No access!' ) ); } ); } to restrict access to the {tools,import,export}.php pages for non-admins.


1

You should use WordPress's default javascript file in admin. Check out ThickBox in Codex. Or, you can use jQuery UI Dialog plugin. You can find procedure to use in this answer of StackOverflow.


0

You can do it by adding your own management screens while removing he original ones from the menu. You will most likely still want to let the admin see the original screens unless you really want to replace the whole admin with exact equivalent which as all the good people in the comments had said is lots and lots of work.


1

In fact, the WP API (also named WP REST API or WP JSON API aims for that (aside from other goals). You can find the project in the repo and on GitHub. The "API" mainly provides data access and (CRUD actions) via GET and POST request running to the /wp-json/ request/URi. You can fetch posts, post collections, users, media, comments and meta data for pretty ...


0

As a rule of thumb, always remove the ending ?> of your .php files, especially if it's a functions or config file that gets parsed before headers are sent to the page. If after that ?> you accidentally add a space, a tab character or a new line, there's your invisible error.


-1

I found my issue. I needed to define memory_limit in my php.ini


0

Do you know debug bar? If you add it and you enable SAVEQUERIES you can see the time every query takes. define( 'SAVEQUERIES', true ); Then you can add more debug bar plugins to profile some other stuff, like Debug Bar Remote Requests for remote requests and Debug Bar Slow Actions to profile WordPress hooks. Most of the times you can easily find a single ...


2

I cannot speak to all plugins loading even when disabled, but gravity forms is not designed for heavy usage and could well be contributing significantly to the problem. I used to work with a large client that used gravity forms and their admin panels ( and submitting forms ) became so slow that eventually they started timing out completely. I no longer ...


2

Check all credentials in wp-config.php. And don't forget about table prefix.


0

It sounds like you have multiple databases and that WordPress is not accessing the correct one. Check your wp-config.php file (in the base of your WordPress installation) and make sure that your database credentials, in particular DB_NAME, are set correctly. You may also need to create/grant access to a new database user. There's about a dozen different ...


0

This $typenow does not have a value during admin_init is not entirely correct. It does have a value set on admin_init in most post type screens like Add New, taxonomy list, taxonomy edit and entry list, but it doesn't have one in the "Edit YourPostType" screen. Also, as others pointed, the correct hook to use to add stylesheets and scripts to WP Admin ...


0

if you need add "back to top button" to admin area use this action - http://codex.wordpress.org/Plugin_API/Action_Reference/admin_footer Or if you need use this button in frontend of you site use one of this plugins https://wordpress.org/plugins/search.php?q=back+to+top , or action: add_action('wp_footer', 'your_function'); to add custom script.


0

Your RewriteBase should be /blogs/ Normally when going through the network setup it will tell you what your .htaccess should do replacing all the previous WordPress rules.


0

Not sure what caused this, a (hackish) fix that worked for me though: RewriteRule ^blogs/([_0-9a-zA-Z-]+)/wp-admin/$ blogs/$1/wp-admin/index.php [L]


0

It's even simpler if, like the OP, you only want to move Menus and Widgets out of Appearance and to the top level. That's what I needed too. Since we're just moving WP core menu items around, we don't need to use add_menu_page to add the menu items back in - we're not adding any new menu items. Just unset them from the $submenu array and re-set them ...


0

In my experience if you are going to move your site from Windows to Apache Web Server you will get about 40% increase in speed as Apache is more efficient for Php Applications like WordPress. But still if you have no choice to turn back you must try 10 Ways to Improve WordPress Performance on Windows. Also I would suggest to use P3 (Plugin Performance ...


3

Ignore my comment about meta_query. Not only does it not work with $query->set(), you wouldn't be able to control the critical "A OR B" requirement of the query. Instead, I believe what you require is possible via a combination of both the pre_get_posts action hook and posts_where filter hook as follows. add_action('pre_get_posts', ...


2

you sad u have access to phpmyadmin. Go to it, find wp_options table Look for custom_wpadmin_slug in option_name and in option_value column will be your's custom defined wp-admin slug If you'll still wount be able to access then remove next lines in .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^{your_wp_admin_slug}/?$ ...


0

In your wp-config.php, you should overwrite the given server-variables that cause the problem by adding this below your database-configuration in wp-config: if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $list = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']); $_SERVER['REMOTE_ADDR'] = $list[0]; } $_SERVER[ 'SERVER_ADDR' ] = DOMAIN_CURRENT_SITE; $_SERVER[ ...


1

Milo noted that there is no $wp_query object in wp-admin page, so we can get $paged via: $paged = ( $_GET['paged'] ) ? $_GET['paged'] : 1; Now that we have $paged, we can code our own pagination. I will demonstrate how in its very simplest form. First let's get maximum pagination pages: $max_pages = $the_query->max_num_pages; Then calculate the ...


0

You need to find the right $menu_slug. The following code worked for me: add_action( 'admin_init', 'remove_menus' ); function remove_menus(){ remove_menu_page( 'wpcf7' ); }


1

You can actually achieve this using simple CSS. If you look at the HTML you can see that each row has some classes: <tr class="post-1349 type-page status-draft hentry alternate iedit author-self level-0" id="post-1349"> There you can see that there actually is a class that indicates a draft: status-draft So now by simply adding an admin style you ...


0

Another different approach is just adding a hidden input field to the form: <input type="hidden" name="page" value="your-page-slug" /> This way, WordPress seems to handle the redirect automatically.


1

If it's native behavior (and not something like third party extensions screwing it up) then update checks should basically fire if there is no data or the time for next check have passed. My educated guess would be it's one of the two: your install not being able to store transients correctly (thus data always empty) your install having time screwed up ...


0

if you don't like this method. maybe you would like the follow code: you can try to put the follow code in your functions.php file- // Theme options /* get options & set default options */ if( !function_exists('share3h_theme_get_options') ) : function share3h_theme_get_options($option){ $share3h_theme_options = ...


0

You can use OptionTree plugin https://wordpress.org/plugins/option-tree/ It also can been worked in theme mode.


2

Rather than blacklist logins, why not whitelist your own IP (example 12.345.67.891 below; or a range) for wp-login.php and in wp-admin for logins and administration? (No plugin needed). A whitelist will block everyone else except you from login. See http://httpd.apache.org/docs/2.4/howto/access.html in the .htaccess in the wp-admin folder: Options All ...


7

I'd say the easiest way to do it is use the get_terms_args filter and unset the number limit if the context is right (the AJAX request to get the tag cloud): function wpse_64058_all_tags ( $args ) { if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_POST['action'] ) && $_POST['action'] === 'get-tagcloud' ) unset( ...


0

add_action( 'admin_menu', 'add_my_admin_menus' ); function add_my_admin_menus() { $GLOBALS['my_page'] = add_menu_page( 'Page Title', 'Menu Title', MY_ADMIN_CAPABILITY, 'menu-slug', 'show_page_content'); add_action( 'admin_enqueue_scripts', 'enqueue_admin_js'); } function enqueue_admin_js($hook) { if($GLOBALS['my_page'] === $hook) { ...


0

The register_taxonomy function has a parameter called show_admin_column that will handle adding a column. Have you tried that?


0

Just add custom-field support to your custom post; register_post_type( 'YourPosts', array( 'labels' => array( 'name' => __( 'YourPosts' ), 'singular_name' => __( 'YourPost' ) ), 'public' => true, 'has_archive' => true, 'supports' => array( ...


0

Open WP-Admin Editing File: Open the file located at: /example.com/public_html/wp-admin/edit-form-advanced.php Edit: Edit these lines to look like the next, adding target=”_blank” to each link or pasting the whole list. $messages = array(); $messages['post'] = array( 0 => '', // Unused. Messages start at index 1. 1 => sprintf( __('Post updated. ...



Top 50 recent answers are included