Tag Info

New answers tagged

0

The second parameter of selected() has to agree with the value attribute of the current <option>. So assuming you have stuffed $selected with the value given by the relevant get_post_meta(), the following should work for you: <label for="myplugin_meta_box_select">Status:</label> <select name="myplugin_meta_box_select" ...


0

add_action( 'admin_footer', 'my_action_javascript' ); // Write our JS below here function my_action_javascript() global $wpdb; $pageposts = $wpdb->get_var("SELECT max(menu_order) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type ='post_trainers'"); ?> <script type="text/javascript" > ...


1

Try add_action( 'admin_menu', 'wpse182102_register_my_custom_menu_page' ); function wpse182102_register_my_custom_menu_page() { add_pages_page(null, 'Menu Item Name', 'edit_posts',/* or whatever capability required for this object */ '/post.php?post='.get_page_by_title('Etusivu')->ID.'&action=edit', null, ''); } And change Etusivu to be the ...


1

Found it! I was missing one custom capability. To the code above, I added this line: $rol->add_cap( 'edit_' . $cap[0] ); It gives the capability edit_ctpsinglename. (edit_pb_publicacion). And now it works just fine. Hope someone find's this useful.


0

Is your problem occurring in a multisite setup? If so, here is a solution: http://thereforei.am/2011/03/15/how-to-allow-administrators-to-edit-users-in-a-wordpress-network/ By default in a multisite setup, only Super Administrators can edit users.


0

Doesn't get_edit_user_link do just that?


0

I just should make Method 1 $object->set('meta_key', 'post_views_count'); Method 2 $query->set( 'meta_key', 'post_views_count' ); Method 3 $vars['meta_key'] = 'post_views_count';


-1

When exporting a DB from localhost, you are much better off opening the sql file in a program like notepad++ and doing a "find replace" on the URL before importing to your server. I find that these type of plugins do more harm then good. Exporting from localhost goes like this for me: Export DB Open `sql` file in notepad++ Find Replace the URL with the ...


0

WP 4.1.1 seems to need a lot more memory than previous versions. Just add define('WP_MEMORY_LIMIT', '256M'); in your wp-config.php file just before the /* Stop editing */ comment line and you should get rid of the blank screens. If you can't access that much memory, go for less, but from my tests the minimum required is 96M. This is probably a bug and ...


1

You can try this modification to your code snippet: function add_post_format_filter_to_posts( $query ) { global $post_type, $pagenow; // if we are currently on the edit screen of the post type listings if ( is_admin() && $pagenow == 'edit.php' && $post_type == 'shop_order' && ! ...


2

Clear your browser cache or use another browser to load the site, this may be a cache issue.


1

If you didn't want to go a plugin route you could build it directly into your theme using default wordpress actions. The first function will create new sections on the user profile screen and the 2nd function will add/remove from the default user profile settings. add_action( 'show_user_profile', 'be_show_extra_profile_fields' ); add_action( ...


1

Here's the way I have always done it. All of this code goes in functions.php. Of course this adds a whole new section to the user profile. add_action( 'show_user_profile', 'be_show_extra_profile_fields' ); add_action( 'edit_user_profile', 'be_show_extra_profile_fields' ); function be_show_extra_profile_fields( $user ) { <h3>Extra Contact ...


0

in http://plugins.svn.wordpress.org/hrm-work-tracking/trunk/hrm-users.php I found such thing with add_action( 'show_user_profile', '' ); add_action( 'edit_user_profile', '' ); add_action( 'personal_options_update', '' ); add_action( 'edit_user_profile_update', '' ); I dont know another way for this


0

Okay found the answer by poking around the code A field can be added by doing the following: add_action('user_new_form','myplugin_add_field'); function myplugin_add_field() { // code to add field }


0

simply you can do that : add_filter('get_user_option_screen_layout_{$post_type}', 'your_callback' ); example with "message" post type : add_filter('get_user_option_screen_layout_message', function() { return 1; } ); You can use '__return_true' in your callback. see: http://codex.wordpress.org/Function_Reference/get_user_option


0

How to fix it ? Go in SQL and write this code : UPDATE `wp2_usermeta` SET `meta_key` = REPLACE(`meta_key`, 'wp_', 'wp2_'); UPDATE `wp2_options` SET `option_name` = REPLACE(`option_name`, 'wp_', 'wp2_'); :)


2

You don't need to check is_admin because the function is hooked to admin_init, so is_admin() is always true in the callback; that makes that ( is_admin() || !empty(DOING_AJAX) ) always verify as true. You only need to check if the constant DOING_AJAX is not defined or if it is defined and it is false (both cases are not an AJAX request), combined with the ...


0

if you add some data on your table you will see the box. If it says "No items found" wordpress doesnt show the box. Add a data, box will appear.


0

1. The easiest way is to use the plugin "Admin Columns", to show the picture in columns https://wordpress.org/plugins/codepress-admin-columns/ 2. You also can code your own admin page with the function add_submenu_page(). http://codex.wordpress.org/Function_Reference/add_submenu_page You can create a query, loop through the posts and show the pictures.


0

I would imagine that your role does not have the capability to delete posts. Maybe try installing a Members plugin and take a look.


5

This is doable, and as I stated in a comment, you need to follow the following steps Get a count the amount of sticky posts. This can be done by simply counting get_option( 'sticky_posts' ) which holds the ID's of the sticky posts in the form of an array You would also need to get the amount of posts per page. You don't want to hardcode here. The amount of ...


0

@Mark Kaplun, This is jQuery it is in theme directory. jQuery(document).ready(function(){ jQuery('.input-group-btn #scrab').click(function(){ var url = jQuery("#url").val(); if(url == ""){ alert("Please specify a url"); }else{ $.ajax({ url: "admin-scraper.php", type: 'POST', ...


0

That's the standard html5 input validation pop up for chrome, you will have to create the pop up from scratch unless your inputs can make use of html5 form validation such as type=email or required


0

I had the same issue. To fix it I had to make some changes to the database. Use phpMyAdmin or just log directly into the database and look at your wp_options table. Check the following two fields: siteurl and home. Make sure these fields hold the correct domain information if not change them and see what happens. In my case the issue was resolved.



Top 50 recent answers are included