Extend SiteOrigin slider with hide frames functionality

The SiteOrigin Widgets Bundle is one of my favorite plugins, not only because it has a bundle of widgets, but also because it is very extendable and allows other developers to customize and add more features to each widget. Moreover the guys of Siteorigin also provide a guide on how to extend the plugin (see https://siteorigin.com/docs/widgets-bundle/)

Recently I wanted to use the slider of the SiteOrigin Widgets Bundle but I also wanted to be able to  hide a frame or two – not deleted, which is the default option if you don’t want to display them anymore. Hiding and not deleting frames is a useful  feature when you have frames for  special occasions and don’t want to recreate them each time you need them.

The only thing needed is a checkbox “Hide this frame” into the frame’s tab, which then should be “be respected” by the rendering function of the slider, so the specific frame won’t be displayed.

The SiteOrigin slider widget’s settings with the “Hide this frame” functionality added.

So the addition of this extra functionality in the SiteOrigin slider turn out to be very easy.

All you have to do is to add the following code into your theme’s functions.php file


multisite, wordpress

Add a sortable user Id column into WordPress Users table

Sometimes it is useful to find the user_id of each user you have in your WordPress site.  This is especially helpful if you have a multisite with a lots of users.  Something like this:


In order to have that kind of functionality,  you can add the following code in your theme’s functions.php.
If you have a multisite installation the ID column will be only displayed in the network users admin page and not in each subsite’s users admin table.



Override bp-signups view with pending users view from ‘new user approve’ plugin

Using BuddyPress and New user approve plugin is a bit confusing for the admin, cause the “pending” users link on top of  users table in admin page, points to BuddyPress pending users. But when the ‘New user approve’ plugin is activated, the pending users are shown in a different page.

In order to fix the link “Pending” displayed on top of the users table, the following filter is needed.


Add download funtionality to Royal PrettyPhoto plugin

A way to extend Royal prettyPhoto plugin to support download image functionality is via Javascript.

Just put the following lines into the functions.php of your theme file.

 * Adds download functionality to prettyPhoto plugin
 * @author lenasterg
function ls_prettyPhoto_Download() {
 echo '<style>.pp_download{ background: #ccc; border-radius: 3px; height: 25px; padding: 4px;}</style>

jQuery(document).ready(function() {
 changepicturecallback: function(){
 $getit= settings.image_markup.replace(/{path}/g,pp_images[set_position]);
 jQuery(".pp_pic_holder").find(\'.pp_details .pp_download_place\').html(\'Download\');


You can download the above code also from gist:



Email to superadmin when a subsite has low available space

Since part of my job is to support a very, very large multisite (and multiuser) WordPress installation, I deal daily with user’s requests and problems.

One of the most frustrating things for them and me, is when the available space of their blog is low. They have to report it to our helpdesk and then wait till we increase it.

Since I couldn’t find a plugin which notice the network admin about low space in subblogs,  I wrote a simple function which does it.

The function sends an email to the network admin when the available space is less then 200MB. It runs every time the blog admin visits the control panel of his/her’s blog.
Just add the following code in your custom.php file.

* Send email to super admin when the blog's available space is less than 200MB
function ls_blog_space_mail() {
$space_left = round( get_upload_space_available() / 1024 / 1024 );
if ( $space_left < 200 ) {
$message = 'Site ' . get_site_url() . ' has only ' . $space_left . 'MB space left. '
. 'If you wish to expand the available space visit ' . network_admin_url( 'site-settings.php?id=' . get_current_blog_id() ) . ' and increase the "' . __( 'Site Upload Space Quota' ) . '."';
wp_mail( get_site_option( 'admin_email' ), "[ " . wp_specialchars_decode( get_option( 'blogname' ) ) . " ]. Low available space", $message );

if ( is_multisite() ) {
add_action( 'activity_box_end', 'ls_blog_space_mail' );

Or find it in github

multisite, my plugins, wordpress

Build it with scratch.mit.edu. Show it in your WordPress site

icon-256x256With Scratch (https://scratch.mit.edu/), you can program your own interactive stories, games, and animations – and share your creations with others in the online community. Scratch helps young people learn to think creatively, reason systematically, and work collaboratively – essential skills for life in the 21st century.

Now, with LS oEmbed support for Scratch Mit  you can just copy-paste the URL from a scratch project into the content area of a post or page
and it will by transformed to oEmbed.

This oEmbed functionality was initial build for the Greek Schools Network blogging platform (http://blogs.sch.gr) and now it is available for all via the WordPress repository in https://wordpress.org/plugins/ls-oembed-support-for-scratch-mit/

The plugin is a useful addon for educational WordPress sites.