Unexpected T_FUNCTION

Check that the user has php >= 5.3 installed. The inline function syntax used on that line only works with that or higher. You can rewrite the line to create a separate function and then call it like this: usort($mz_classes, ‘myFunction’); For more info: http://php.net/manual/en/function.usort.php

Get post thumbnail in WP_Query

Do you mean the featured image? Use wp_get_attachment_image – Here is the code that I use in my plugin while ( $the_query->have_posts() ) :$the_query->the_post(); $image_id = get_post_thumbnail_id(); $imagesize=”thumbnail”; $image_url = wp_get_attachment_image_src($image_id, $imagesize, true); //do something endwhile; You can also use wp_get_attachment_url( $id );

How to hide page links from theme menu

Most of users use wp_nav_menu to output the menu in a theme, then you could make use of the callback function that is passed in the arguments array. wp_nav_menu( array( ‘fallback_cb’ => ‘wp_page_menu’ ) ); wp_page_menu is the default value for the callback function. Looking further, wp_page_menu has an exclude key in its arguments array. … Read more

How to translate wordpress backend to another language

Just so you know, a Sinhala translation is already in progress. https://si.wordpress.org/ http://wpcentral.io/internationalization/si/ Maybe it would be a good idea to join that team. First, you need to create .po files for the Sinhala translation of WordPress. You’re going to need four of these files. They will be called si_LK.po admin-si_LK.po admin-network-si_LK.po continents-cities-si_LK.po If all … Read more

Screenshots on plugin page taken old [closed]

Reason was simple: “wp-plugin-in-github” tool has not any delete assets functions. So in git repo there were no screenshot-1.png, but in svn repo — it was. See: https://github.com/sudar/wp-plugin-in-github/blob/e5a004052342cbdfc5bd7fbcb844fffce8695f91/deploy-plugin.sh#L231 Workaround to work: find $SVNPATH_ASSETS -type f -not -path ‘*.svn*’ -delete cp $GITPATH/$ASSETS_DIR/* $SVNPATH_ASSETS # copy assets */ cd $SVNPATH_ASSETS # Switch to assets directory svn status … Read more