WordPress

Handy plugins, resources and snippets for WordPress.

Useful resources

Developing themes

It can be a lot of work to start from nothing, therefore it can be useful to start from a boilerplate:

Developing plugins

Useful plugins

Development

Editing

Security and Logging

Content plugins

Widget plugins

Admin UI

Performance

MultiSite/Network related

Manage remote WordPress installations with ManageWP Worker.

Forms

Multilingual websites

Snippets

Get a post from another multisite

You can do this:

switch_to_blog( $site_id );
$post = get_post( $post_id );
restore_current_blog();

But this function is also in WP core:

function get_blog_post( $blog_id, $post_id ) {
    switch_to_blog( $blog_id );
    $post = get_post( $post_id );
    restore_current_blog();

    return $post;
}

More background information:

Misc.

Posts

API

Moving WordPress (changing the domain and/or location)

remove_action('template_redirect', 'redirect_canonical');

wp-login.php can be used to (re-)set the URIs. Find this line:

require( dirname(__FILE__) . '/wp-load.php' );

and insert the following lines below:

// Comment or remove these lines of code once the database is updated,
// due to performance. Good to know: they don't kick in when the url and
// home are defined in wp-config.php.
update_option('siteurl', 'http://your.domain.name/the/path' );
update_option('home', 'http://your.domain.name/the/path' );