Disable login on multisite web sites

You can have a single login point which you can redirect to from all sites in the network, and then redirect back to the subsite after a successful login. We did something similar for the WordCamp.org network: http://meta.svn.wordpress.org/sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-global-login.php This will probably only work for subdomains, since you can’t really set a cookie for a different … Read more

How to change the descriptive text on the menus admin page?

The text you are referring to is located in here: wp-admin/nav-menus.php. But we will not edit directly. We will use functions.php for the convenience of preserving the changes after an upgrade. Use the following code in functions.php add_filter( ‘gettext’, ‘wps_translate_words_array’ ); add_filter( ‘ngettext’, ‘wps_translate_words_array’ ); function wps_translate_words_array( $translated ) { $words = array( // ‘word … Read more

Ajax call through admin-ajax.php returns 404 error

success and error are functions, not properties of AJAX function. Working code: $(“.tabs .btn”).click(function(e) { e.preventDefault(); $.ajax({ url:”/wp-admin/admin-ajax.php”, type: “GET”, dataType: “html”, cache: false, data: { action: “shows” } }) .success(function(resp) { $(“.ajax-show”).append(resp); }) .error(function(xhr, status, error) { var err = JSON.parse(xhr.responseText); console.log(err); }); }); Also that should be noted: Deprecation Notice: The jqXHR.success(), jqXHR.error(), … Read more

Menu deletes all items and position – wordpress bug?

I think this is a bad case of taxonomy split introduced in WP 4.2 ref. https://make.wordpress.org/core/2015/02/16/taxonomy-term-splitting-in-4-2-a-developer-guide/ Solution for this would be to use this plugin to detect and fix the splitting before Updating menus which is a bit buggy in my opinion. Update nav menus will trigger “wp_nav_menu_update_menu_items” function which between split gives new menu … Read more

How to pass a specific post id from “all posts” list in Admin panel

Assuming you’ve added the column correctly and not hacked it in somehow, then the manage_${post_type}_posts_custom_column filter should do what you want. The example in the Codex is about the best I’ve got given the sparcity of information in the question: add_action( ‘manage_posts_custom_column’ , ‘custom_columns’, 10, 2 ); function custom_columns( $column, $post_id ) { switch ( … Read more

Problem after updating plugins

There is problem with the “wordpress-seo” permission so please following steps. There are two way 1) Upload from the wp-admin Step 1 -> Change the “wordpress-seo” permission or rename the “wordpress-seo” plugin to another Step 2 -> If you have change the permission then just upgrade the plugin and if you have rename the plugin … Read more

Adding CSS-class to WordPress Menu in backend

I made it different for that project. Using ACF Pro (anyway) + a mod of “Code Area“. Return that Code Area CSS via add_action(‘admin_head’, ‘function_name’); in my admin-area. So I am able to put the IDs in my CSS field => Voilà. A different way, but works exact as I wanted/ needed.

Admin Ajax is returning 0 and not Insert data

A 0 status from admin-ajax.php indicates that no “action” is being parsed. When you enqueue the script you are assigning a handle, this handle needs to be used when you use wp_localize_script and additionally you need to assign the url. https://codex.wordpress.org/Function_Reference/wp_localize_script wp_register_script( ‘some_handle’, ‘path/to/myscript.js’ ); wp_localize_script( ‘some_handle’, ‘object_name’, array( ‘ajax_url’ => admin_url( ‘admin-ajax.php’ ) ); … Read more

Load stylesheet on custom admin submenu page

Ok, I figured it out: If it’s a submenu page, the $hook looks like this: appearance_page_page-name instead of going by URL. So the complete code would be this: function my_function($hook) { if ( ‘appearance_page_page-name’ != $hook ) { return; } wp_enqueue_style( ‘custom-style’, get_template_directory_uri() . ‘custom-page/style.css’ ); } add_action( ‘admin_enqueue_scripts’, ‘my_function’ );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)