Tag Info

New answers tagged

1

There are no page folders in WordPress, though that's a good idea. Create subpages; that will give you a visual hierarchy, an also an automatic "breadcrumb" hierarchy, if useful. But you will still be able to organize pages in menus any way you want. See https://codex.wordpress.org/Pages And/or use CMS Page Tree View ...


2

If I understand well your want to show the widgets adding and removing interface inside a meta box. An easy, -a little dirty- way is using an iframe: function metaboxed_widgets_admin() { if ( ! current_user_can( 'edit_theme_options' ) ) return; add_meta_box('metaboxed_widgets', __('Widgets'), 'metaboxed_widgets_admin_cb', 'page'); } add_action( ...


0

Turns out you can't use uppercase taxonomy ids. Those work, mostly, but when WordPress sanitizes Ajax calls, everything uppercase is converted to lower case and it won't find the correct taxonomy. The solution is to only define and use lowercase taxonomy ids.


2

Yes, that’s safe. I have done that. The core does not rely on the existence of such a user. There might be some broken plugins whose authors think user 1 is always there and an admin, they will not work properly. On the other hand, this is a very simple test for a plugin: If it doesn’t work after you have deleted user 1, it is probably very insecure, and ...


0

It sounds like you want a membership site that restricts content to certain membership levels. There are several membership plugins available for WordPress and several reviews of the options. One site what has several articles on membership plugins is: chrislema.com


1

Yes it is, and this can be a very handy feature. The 'hiding place' for widgets is one of the least intuitive designs of the Wordpress backend, IMHO. You can use a plugin such as: Widgets on Pages Or perhaps a more up-to-date one such as Widgetize Pages Or you can build code yourself and place it elsewhere in the admin (such as the dashboard). A tutorial ...


0

For starters, the WordPress Codex has a wealth of information on this very topic. For the sake of brevity that should take care of most of it; however, there are some relievant points that should be made: If you do not wish WordPress (essentially PHP) to have access to the file system with the exception of dynamic static assets such as images or cache then ...


1

Inspect the global variable $pagenow, and use post_type_supports() to find post types with an editor: function has_post_editor() { global $pagenow; if ( empty ( $pagenow ) ) return FALSE; if ( ! in_array( $pagenow, array ( 'post-new.php', 'post.php' ) ) ) return FALSE; return post_type_supports( ...


0

This is what you're looking for: http://codex.wordpress.org/Plugin_API/Action_Reference/init Example from Codex: add_action('init', 'process_post'); function process_post(){ if(isset($_POST['unique_hidden_field'])) { // process $_POST data here } }


0

Too bad WP doesnt provide in-built configs for production and local envs like PHP frameworks. You'll have to change siteurl and home in wp_options to the production site URL


1

Actually is not true that on post-new.php global $post is not defined, WordPress create a post and save it in database as auto-draft using get_default_post_to_edit before output the page and so the metabox, so you can rely on global post object. However, I don't like using global post object and to get the brand-new post on post-new.php I use transition ...


0

The first thing to check with a 'headers already sent by...' error is that you have no white space at the very start or the end of your php file. Check your images-options.php file and remove any errant space at the very start or the end of your code.


0

Given that your question is self-explanatory, here is a self-explanatory answer. <a href="themes.php?theme=mythemename&action=theme-details">My Modal</a> You need to put this in your code, otherwise it will not work. You need to click "Copy". Then open your code in the software. And paste.


2

The reason you get notices for stopping inserts with the wp_insert_post_empty_content filter as mentioned in your comment at the http://wordpress.stackexchange.com/a/51980/31794 answer, is that: For post-new.php the auto-draft process needs to get a $post->ID through get_default_post_to_edit() and wp_insert_post(), and use that ID from the $post return. ...


5

This should get you started. I've used a timeout of 5 minutes to allow for time sitting idle on the website. You could improve the accuracy with a script (if the current user is the admin) & pinging an AJAX request every few minutes to update the admin_last_seen timestamp. /** * Check if the admin was last online at least 5 minutes ago. * * @return ...


0

I think I figured this out. I wanted to leave my findings here with the hope that others can correct anything I may have erred on or findings I have misinterpreted. Testing Method: I set up a new vagrant install with a lamp stack (sudo apt-get install lamp-server^). I first set up wp_cli -- the commandline tool akin to drush -- which sped along the ...


1

By default when you run a query for a hierarchical taxonomy term, WordPress also returns post from its children. This happen on backend and on frontend as well. 'tax_query' argument has an argument 'include_children' that was introduced for the scope, from Codex: include_children (boolean) Whether or not to include children for hierarchical taxonomies. ...


0

Apparently the W3 Total Cache plugin caused this problem. I tried removing the toolbar via CSS by using 'display:none;'. When this didn't work I found that the CSS that styled the toolbar was in one of the cache folders of this plugin.


2

I have found the solution. After searching the whole of the WordPress database, I got the "divine" inspiration to check out the .htaccess file. The custom-login script had modified the file. I just removed the line RewriteRule ^.*wp-admin/?|^.*wp-login\.php /not_found [R,L] and everything started working again.


0

If Pieter's comment doesn't work (and it's a good suggestion) then you need to go into MySQL using PhpMyAdmin or similar and change the URL. The following post should help guide you through in greater detail: http://wordpress.shadowlantern.com/how-change-wordpress-url-phpmyadmin/


0

Rather than delete, rename all the updateded directories (e.g. akismet-off) via ftp and then try logging in again.


3

admin_init runs on admin pages, not the front end. The equivalent front end action, init, is too early to check is_page. A safe action for redirection is template_redirect: function xyz() { if( is_page( 172 ) && ! current_user_can('update_core') ) { wp_redirect( home_url() ); exit; } } add_action( ...


1

Yes, the count for pages in various statuses that you see above the list table is obtained running wp_count_posts but the pages in the table are obtained running a WP_Query and the 2 things are completely unrelated. If you want to also modify the count, you have to filter also the output of wp_count_posts using the 'wp_count_posts' filter hook. Also you ...


1

The post count uses the wp_count_posts() function, which ignores any query filters. You'll need to tweak it manually with the use of the wp_count_posts filter: function wpse_139851_count_posts( $counts, $type ) { if ( $type === 'page' && ! empty( $counts->publish ) ) $counts->publish--; // Decrease by 1 return $counts; } ...


1

Yes this is possible. Add the following to either your plugin code or the theme's functions.php file: function mypo_parse_query_useronly( $wp_query ) { if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) { if ( !current_user_can( 'update_core' ) ) { global $current_user; $wp_query->set( ...


7

You can try this: is_admin() && add_filter( 'gettext', function( $translated_text, $untranslated_text, $domain ) { $old = "Plugin <strong>activated</strong>."; $new = "Captain: The Core is stable and the Plugin is <strong>activated</strong> at full Warp speed"; if ( $untranslated_text === ...


3

Try manually resetting your plugins. If that resolves the issue, reactivate each one individually until you find the cause. If that does not resolve the issue, manually rename the directory of currently active theme, This will force the Default theme to activate. And you find out theme related issue.(theme function can affect the admin panel)



Top 50 recent answers are included