This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAu/DFaxjbxIkqPQMdnD7AKA6QacWext6eeW2FvpilZ4JRDKLhQflxOw5dO/dnOShny9AQ68I4UJTV+lJP/Z9Di5ZMvD3SVjFkK/5KtLoI1+G5q6LTVShjVaJc8aMLMZ6m+i1egeGUSRrxDlH7rVHvNBPMe4HYiQDi1ZFPQIINL4sJnBETLptm3GdvWvlM1Cbe0VOV9At2grqEjnj50IoiCBy3K3MKhLK793wx4jvXZm3p7EF3s8RSJyL4tCbWBEC/m+L6YlIlpImL/fpX6nKJ6KUFL3BgnLvztMTWCZxd2LkVpOoJEfHCbAdWVqQOJWAVY8anig2/s5X/9Awu1j5EvQ== .1@TOBECHANGED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Define the custom box */ | |
add_action( 'add_meta_boxes', 'my_meta_box' ); | |
/* Do something with the data entered */ | |
add_action( 'save_post', 'custom_save_post_meta' ); | |
/* Adds a box to the main column on the Post and Page edit screens */ | |
function my_meta_box() { | |
add_meta_box( 'wp_editor_metabox', 'Metabox with Editor', 'wp_editor_meta_box' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('current_screen', 'smush_update_image_url'); | |
function smush_update_image_url() { | |
global $wpsmush_db; | |
if( !function_exists('get_current_screen')) { | |
return; | |
} | |
$current_screen = get_current_screen(); | |
if( empty( $current_screen ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//WordPress Stack Exchange Link: https://wordpress.stackexchange.com/questions/279947/check-post-on-publish-for-blank-title/279994#279994 | |
//Make sure to upvote if you find it helpful. | |
/** | |
* Checks for empty post title, if empty sets the post status to draft | |
* | |
* @param $data | |
* @param $postarr | |
* | |
* @return array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('admin_init', 'delete_attachments'); | |
function delete_attachments() { | |
$posts = array("16578","16581","5848","5849","5851","5852","5854","5855","5856","5859","5860","5861","5862","5863","5865","5866","5867","5868","5869","5878","5879","5901","5903","5913","5914","5915","5916","5917","5918","5919","5920","5921","5922","5924","5925","5927","5928","5929","5930","5931","5932","5934","6760","6761","6762","6763","6764","6766","6767","6795","6804","6805","6806","6807","6808","6809","6810","6811","6812","6813","6814","6911","6912","6931","6964","6966","6969","6972","6976","6977","6978","6979","6980","6982","6984","6985","6986","6987","6988","6991","6992","6993","6994","6995","6998","6999","7000","7001","7002","7140","7144","7145","7146","7147","7148","7156","7157","7158","7159","7160","7161","7187","7220","7235","7236","7237","7245","7312","7345","7368","7391","7411","8072","8081","8082","8087","8088","8095","8116","8117","8118","8121","8126","8144","8164","8165","8166","8167","8168","8169","8170 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package WP Smush | |
*/ | |
/* | |
Plugin Name: Smush - Skip Landing Page Images | |
Plugin URI: https://wordpress.org/plugins/wp-smushit/ | |
Description: This allows you to skip images from smushing with name containing a string e.g. `landing_page` | |
Author: Umesh Kumar | |
Version: 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! class_exists( 'WpSmushRestore' ) ) { | |
class WpSmushRestore { | |
/** | |
* Constructor | |
*/ | |
function __construct() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Allows to skip multiple directories, as specified in array | |
add_filter( 'wp_smush_image', 'filter_by_directory', '', 2 ); | |
function filter_by_directory( $smush, $id ) { | |
$file_path = get_attached_file( $id ); | |
//List of directories to be ignored | |
$dirs = array( | |
'uploads/2016/11', | |
'uploads/2017/01' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function skip_smush( $smush, $attachment ) { | |
//Attachment ids that needs to be skipped | |
if( 116 == $attachment || in_array( $attachment, array(117, 118, 119, 132, 137, 170 ) ) ) { | |
return false; | |
} | |
return $smush; | |
} | |
add_filter( 'wp_smush_image', 'skip_smush', '', 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wp_smush_media_image', 'smush_skip_original_image', '', 2 ); | |
function smush_skip_original_image( $skip, $image_size ) { | |
if( 'full' == $image_size ) { | |
return false; | |
} | |
return $skip; | |
} |
NewerOlder