Optimize and delete images in WordPress

Good question, I have a chance to write a small wrapper that basically implements such functionality… I was thinking about when I should run my optimization and what exactly I should process files. Ended up in next conclusions… The main Image will be changed somewhere later, using wp_cron schedule. Nothing particularly interesting… you taking your … Read more

How to display widget in front end?

In order to display widget in the front end, on any page template, just add this line. the_widget(‘widget class name’) for more details, read wordpress codex: https://codex.wordpress.org/Function_Reference/the_widget

Fetching WP.me shortlinks for posts using WP Rest API

This has been resolved by registering a new field in the rest api using the following functions. add_action( ‘rest_api_init’, ‘sam_add_custom_rest_fields’ ); function sam_add_custom_rest_fields() { $sam_short_link_schema = array( ‘description’ => ‘Short Link’, ‘type’ => ‘string’, ‘context’ => array( ‘view’ ) ); register_rest_field( ‘post’, ‘samad_short_link’, array( ‘get_callback’ => ‘sam_get_short_link’, ‘update_callback’ => null, ‘schema’ => $sam_short_link_schema ) ); … Read more