Tag Info

New answers tagged

0

Try this: function options_instructions_example() { global $my_admin_page; $screen = get_current_screen(); if ( is_admin() && ($screen->id == 'custom_post_type_name') ) { function add_content_after_editor() { global $post; $id = $post->ID; echo '<div class="postbox" ...


0

Starting with Wordpress 4.1 (maybe even earlier, I don't know) this functionality is built-in (no need for a plugin). Simply: Download the language pack of your choice from http://wpcentral.io/internationalization/ extract the content into wp-content/languages (create the languages folder if it does not exist yet) Done! Logon as the editor who needs a ...


0

The question pretty much got covered in another thread here. In case anyone else need anything like this I ended up using following code to hide all the posts that are over a week in the future. function hide_future_posts($where, $q) { if(is_admin() && $q->is_main_query() && !filter_input(INPUT_GET, 'post_status') && ( ...


0

After a bit more research, I have found a way to do this from this post http://wordpress.stackexchange.com/a/136064/54989 Rather than using unset as I had done previously, remove_menu_page works for Duplicator: remove_menu_page( 'duplicator' ); so my complete code now looks like: function jitb_remove_admin_menu_items() { if ( !current_user_can( ...


1

It's not clear what you're looking for here, but you could try to use the posts_where filter: /** * Remove posts, with a given status, on the edit.php (post) screen, * when there's no post status filter selected. */ add_action( 'posts_where', function( $where, $q ) { if( is_admin() && $q->is_main_query() && ! ...


0

I can suggest two step: Try to deactivate all plugins (howto: this and this); Check if the core of Wordpress hasn't broken. Compare sources in directories wp-admin & wp-includes (it's difficult, but I don't know easy way).


0

Unluckily does not exists a filter like that. However, output pass throught WordPress usual filters. E.g. 'the_title' for title. The only problem is that you can't just add a filter to the 'the_title', because it will affect a lot of things. However you can use filters that are triggered only on post list admin screen (edit.php) to add the filter to title. ...


2

CSS is the answer. If you look at the HTML code of each row (<tr>), you will see that it has classes that include post ID, post status, post tags, categories, and so on. So, you can easily apply CSS rules based on that classes and based on post tags. For example, this is a row in one of my site: <tr id="post-24392" class="post-24392 type-post ...


4

This is a little hacky, but doesn't require you to edit core files, which you should never do, as you are aware. add_action('admin_init', function() { $_GET['mode'] = 'grid'; }, 100); This will always force the mode into grid view. What it does not do, it does not remove the List View icon it does not change the query argument in the URL To ...


-1

You can use the Advanced Custom Fields plugin for that. Beside that, ACF provides you more field types you can use. And instead of showing the featured image in single.php, you can echo the one uploaded in your additional field.


3

The basic mistake is, that every data is available at the point where you write your code. That isn't the case and hooks are there to provide access to the core code during different states of the core loading procedure graph. In short and very simplified things run like this: # core loads // ...more stuff... # point at where all must-use-plugins are ...


0

If all you're wanting to do is save extra post data you should not need jquery or custom ajax. Wordpress has a built in action you can use to achieve this same thing. add_action( 'save_post', 'save_more_post_meta' ); function save_more_post_meta( $post_id ) { //save stuff here } If you need help with saving specifics i'll need a little more detail


-1

So I finally found the solution. If installed the: "Extended Super Admins" plugin. And then I the user the Super Admin role, and used the plugin to add a custom role based on the super admin and then it is just check the boxed of the rights he DON'T need to have. It was really that simple!


0

Atlast i found the solution, it was very silly mistake. It got nothing to do with plugin or theme or any code. It was one of the WordPress settings which i didn't realize. Following pic shows the option to switch between excerpt view and list view of posts in wordpress. I by mistake selected excerpt view and thought it was a bug. Thanks for Pieter Goosen ...


1

In multisite installation there already is a default admin and super-admin role, and if standard capabilities are different than what you want you can modify them: A default set of capabilities is pre-assigned to each role, but other capabilites can be assigned or removed using the add_cap() and remove_cap() functions. New roles can be introduced or ...


0

This is pretty simple. All I did was open phpmyaddmin, I selected a database from my former website I created, searched for wp_usermeta, clicked on user_capabilities, and since admin id is 1, all I did was copy the strings (a:2:{s:13:"administrator";b:1;s:13:"bbp_keymaster";b:1;}) and pasted it in my problematic db. Clicked save, log out the log back in ...


0

I ended up filling my requirement using this PLUGIN.It Does what I really needed.


0

register_post_type is recommended to be used in init action hook. So, get_post_types should be used in an action after init. Hooking in init with a very high priority, 999 or greater, should also work in almost every situation but it is safer to use a later action hook. Example: add_action('wp_loaded', function(){ $post_types = get_post_types( ...


0

Here's one idea: /** * Reactivate the sticky theme, if someone activates another theme. */ add_action( 'switch_theme', 'wpse_permanent_theme' ); function wpse_permanent_theme( $new_name ) { $sticky_theme_name = 'twentyfifteen'; // Modify this to your needs! // Get the sticky theme info, to check if it exists (named): $sticky_theme = ...


0

It turns out we had inadvertently created a single conventional category together with our dozen or so custom categories (this probably happened using the WP Ultimate CSV Importer which, for some of our imports, I think we'd filled in the category field hoping it would map to our custom category; it didn't and we forgot about it). We checked the ...


0

Instead of disabling it, you'd be better off by hiding it using a bit of CSS trickery. Try this and let me know if it works: add_action('admin_head', 'hide_quick_view'); function hide_quick_view() { echo '<style> span.view {display: none !important; visibility: hidden !important; opacity: 0 !important;} </style>'; } This should ...


0

Instead of adding your column label "view" as a string, pass it in as an array with 1 as the second value. Like this: array('view',1) Full Code: add_filter( 'manage_edit-post_sortable_columns', 'my_sortable_view_column' ); function my_sortable_view_column( $columns ) { $columns['post_views'] = array('view',1); return $columns; } I don't have a WP ...


0

I just had this problem. This is how I fixed it... Pass $args = array( 'show_title' => false ); as a parameter. So yo would have something like this: // arguments for Theme My Login $args = array( 'show_title' => false ); Theme_My_Login( $args ); I was showing the login form in a modal so I used this to add the login form without the title.


0

An alternative solution is to use WP REST API: http://wp-api.org/ If your custom post type uses custom fields, the RESP API saves you the trouble of including the custom fields in the RSS.


0

For anyone who wants to add their own admin menu ;) The format is, <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?> <?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); ?> (from wordpress codex) <?php defined( 'ABSPATH' ) or ...


2

The $function argument of add_menu_page should be a function that produces your page output, or if omitted, then the $menu_slug argument can be a file that when included will output the menu page. But your output right now has nothing to do with the add_menu_page call, the problem is that you're requiring aio_dashboard.php, which has a function hooked to ...


0

Those links are hard-coded to display in the "title" column as part of class-wp-posts-list-table.php. Look at the single_row() method in that file, specifically the case 'title' to see how those links are constructed. You can probably re-use the same code in your plugin or theme as long as you comply with the GPL license WordPress uses.


0

First, you have a blog on WordPress.com, so you can't change any code to make this happen. To start with, is all of the "background" above correct? Yes. Is there a way to enable the reply buttons on all levels of comments? No, not on WordPress.com. If you self host a site, there are ways to do this. If not, is there a known reason for the ...



Top 50 recent answers are included