Tag Info

New answers tagged

1

This is pretty off-topic -- this site is meant for WordPress programming questions -- but here's an answer anyways. If you're referring to WordPress.com's Terms of Service, what you are granting WordPress (actually Automattic, WordPress's parent corporation) is as follows: By submitting Content to Automattic for inclusion on your Website, you grant ...


2

I banged my head against the wall trying to move the admin functions on wordpress to a separate server. I thought I'd just add to it that having two host names does break the "preview" function in the editor, and so you need to modify your .htaccess to make that work again. #special fixes on previews when wordpress sends user to the public blog & we ...


0

I do not really know where your problem comes from but I know a trick to fix this issue in some case : ErrorDocument 401 default This code goes in main .htaccess at the very beginning. Hope this will do the job.


0

To get the current role of the user $current_user = wp_get_current_user(); if ( !($current_user instanceof WP_User) ) return; $roles = $current_user->roles; //$roles is an array After getting role set page ids which you want to show according to roles (for example) if($roles=='administrator'){ $args=array('21','22','23'); } or ...


1

There is a meta capability create_posts that is not documented but is used by WordPress to check before inserting the various 'Add New' buttons and links. In your custom post type declaration, add capabilities (not to be confused with cap) and then set it to false as below. register_post_type( 'custom_post_type_name', array( 'capabilities' => array( ...


1

Dominik Schilling - the author of the WP 3.5 media manager - has written a set of demos for media modals. You can view them on GitHub.


1

You can control columns in most admin panels by clicking Screen Options at upper right of the screen and (un)checking them as you want. This is however saved individually for user and to get rid of column for all users would involve writing code to hook into internals and unregister it.


2

To copy a post from one blog to another you can do something like this: function copy_post_to_blog($post_id, $target_blog_id) { $post = get_post($post_id, ARRAY_A); // get the original post $post['ID'] = ''; // empty id field, to tell wordpress that this will be a new post switch_to_blog($target_blog_id); // switch to target blog ...


0

There are some issues with the solution in the linked answer. But it is a good starting point for it. Basically you have to change only the method ajax_change_status(). This method changes the post status, but you want to change a post meta. In short, this is the final class with some fixings /** * Plugin Name: Change Book Availability On Post List * ...


4

It's not well documented, but the add_node and add_menu methods of the WP_Admin_Bar class can be used not only to create new menu or nodes, but also to update an existing menu or node. So i went ahead and tracked down the code that WordPress initially uses to create that item in the admin bar, replicated it, then made adjustments to the Howdy text and used ...


2

The problem was that I had changed the 'WP_CONTENT_DIR' directory, and Wordpress did not have writing permission to the new content folder, so it couldn't create the 'WP_CONTENT_DIR'/languages folder. After creating the languages folder in my new WP_CONTENT_DIR directory Wordpress did the language upgrade successfully.


0

Codex has documentation on creating custom login pages - Customize Login Form > Make Custom Login Page, using wp_login_form() function. This should load everything necessary to log user in. However, unlike login, replacing admin would be much more involved and have many approaches. Typically to access admin function in non-admin context admin PHP files have ...


1

See http://codex.wordpress.org/WordPress_in_Your_Language Try download this package http://nb.wordpress.org/ If its not working. This package should obtain Norwegian language.


0

IMO, it's much better to solve this with Ajax. Maybe it's possible the way you're proposing, but it seems a bit confusing from an User Experience perspective: two similar buttons that do different things. What if the user modifies the content and the custom fields, updates one and loses the other? Maybe the save_post action hook should be just a backup ...


2

Removing the hierarchical parameter from the register_post_type function call did the trick, as per vancoder's suggestion. On the back end, looking at what the hierarchical option does (set the new post type to behave like the page post type) tells me that it probably shouldn't have been set in the first place.


1

Well this is embarrassing. I found the culprit, it was one of my theme :( Enabling Twenty Twelve solves the visual editor issue. Sorry guyz and thanks for the support.


1

&nonce should be ?nonce. The ? begins a query string, the & separates arguments within a query string.


0

I don't know if it's the best practice but if i use the following href it works: href: '../wp-admin/admin-ajax.php?nonce='+ajax_var.nonce


1

That plugin loads its language the moment its main file is included: load_plugin_textdomain( 'wordpress-seo', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); So when your locale filter is used, the language is already there. :/ Move your small plugin into the mu-plugins directory. You can create it if it doesn’t exists in wp-content. That ...


1

This is in wp-admin/js/common.js or wp-admin/js/common.min.js: // Scroll into view when focused $('#contextual-help-link, #show-settings-link').on( 'focus.scroll-into-view', function(e){ if ( e.target.scrollIntoView ) e.target.scrollIntoView(false); }); Found with a search for show-settings-link in the complete source. :)


1

To all the folks who get this kind of error a must check option. turn on error reporting if you have commented the lines in your wp-config.php @ini_set('display_errors','Off'); and than check for error. if it has the error like this PHP Warning: Cannot modify header information - headers already sent by (output started at /[server ...


0

To all the folks who get this kind of error a must check option. turn on error reporting if you have commented the lines in your wp-config.php @ini_set('display_errors','Off'); and than check for error. if it has the error like this PHP Warning: Cannot modify header information - headers already sent by (output started at /[server ...


0

To all the folks who get this kind of error a must check option. turn on error reporting if you have commented the lines in your wp-config.php @ini_set('display_errors','Off'); and than check for error. if it has the error like this PHP Warning: Cannot modify header information - headers already sent by (output started at /[server ...


1

Before anything... to get a good answer, you need to provide a good question. Code examples would help a lot. You can use jQuery to accomplish what you need. Suppose your checkboxes are in a list. You can assign an ID to the list UL. You can use jQuery to run through every element in that list and see if the checkboxes are checked $("#checked ...


0

To modify logout URL (in admin) edit your functions.php: add_filter( 'logout_url', 'custom_logout_url'); function custom_logout_url( $login_url) { $url = str_replace( 'wp-login', 'your_logout_file', $login_url ); return $url; }


0

i found the problem there was space in function.php


-1

Add this code to theme's functions.php file add_action('init', 'clear_buffer_output'); function clear_buffer_output() { ob_start(); }


1

It is a bit tricky to get the ID fropm the form because it is created dynamically. Normally I use this JS to trigger an event when the save button is pressed: jQuery(document).ready( function($) { $( '.widget-control-save' ).on( 'click', function() { // grab the ID of the save button var saveID = $( ...


1

Try to set the constant COOKIE_DOMAIN to an empty value or the value of the real address. Example: define( 'COOKIE_DOMAIN', '' ); Be aware WordPress has a lot of issues with symlinks, so there might be other problems too.


2

Yes I recently ran into the situation where I wanted to change the profile link in the user-info section of the admin bar. The problem is that you can only get all nodes, add and remove them. Not edit. And you also cannot modify the $wp_admin_bar->nodes property due it is private. When easily removing and adding them, you'll lose your order and the whole ...



Top 50 recent answers are included