how to invoke wordpress API from other existing PHP system

You can add the following snippet at the start of your PHP file to load WordPress in it. define( ‘WP_USE_THEMES’, false ); require(‘wp-blog-header.php’); // chage the path to match your WP directory //the rest of your code here EDIT: Alternatively, you could use wp-load.php instead of wp-blog-header.php. define( ‘WP_USE_THEMES’, false ); require(‘wp-load.php’); // chage the … Read more

Add custom text color WordPress 3.9 TinyMCE 4 Visual editor

Aleksandar Urošević addressed this specific scenario (which is different than adding a button, as you’ve noted). This is the WP 3.9 approach: function mytheme_change_tinymce_colors( $init ) { $default_colours=” “000000”, “Black”, “993300”, “Burnt orange”, “333300”, “Dark olive”, “003300”, “Dark green”, “003366”, “Dark azure”, “000080”, “Navy Blue”, “333399”, “Indigo”, “333333”, “Very dark gray”, “800000”, “Maroon”, “FF6600”, “Orange”, … Read more

Has is_archived() for sites in a multisite changed with WP 4.7?

Can you try out the following code somewhere and post the output? $mySites = wp_get_sites($args); foreach ($mySites as $blog){ print_r(get_blog_status($blog[‘blog_id’], ‘archived’)); } If this works, I suspect the code behind is_archived() used to understand blog-objects, but the function is supposed to recieve only the blog ID, not the whole object. Your code should be the … Read more

How do I find where the current value of the option ‘registration’ in the SQL database?

Note that the function get_site_option() works a bit differently from get_option() on its own. On WordPress Multisite (ie, with Network Mode enabled), there are two different kinds of options: site-specific options, which are stored in the individual options tables for each blog (wp_options, wp_5_options, etc). These options are accessed with get_option(), update_option(), etc. Note that … Read more

Multisite domain mapping breaks CSS

This is an old question, but I just ran into this same issue and found the problem: the MU Domain Mapping plugin is using a deprecated constant, PLUGINDIR, to remap the plugin directories on the mapped domains. The plugin seems to be very vaguely developed nowadays (and no releases have been out for a year), … Read more