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

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:

//FIXME: do comment/remove these hack lines. (once the database is updated) update_option('siteurl', 'http://your.domain.name/the/path' ); update_option('home', 'http://your.domain.name/the/path' );