This file contains hidden or 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
Check the link | |
https://github.com/lafeber |
This file contains hidden or 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 a Image Uploader for each taxonomy | |
// Add term page | |
function rtp_news_image_add($tag) { | |
// this will add the custom meta field to the add new term page | |
$get_img = get_option( "custom_marketimg_id_$tag->term_id" ); ?> | |
<table class="form-table"> | |
<tr class="form-field"> | |
<th> |
This file contains hidden or 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
jQuery(document).ready(function(){ | |
var _rtp_media = true, | |
_orig_send_attachment = wp.media.editor.send.attachment; | |
jQuery('.rtp-media-uploader').click(function () { | |
var button = jQuery(this), | |
textbox_id = jQuery(this).attr('data-id'); | |
_rtp_media = true; |
This file contains hidden or 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 change_post_menu_label() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'Contacts'; | |
$submenu['edit.php'][5][0] = 'Contacts'; | |
$submenu['edit.php'][10][0] = 'Add Contacts'; | |
$submenu['edit.php'][15][0] = 'Status'; // Change name for categories | |
$submenu['edit.php'][16][0] = 'Labels'; // Change name for tags | |
echo ''; |
This file contains hidden or 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 | |
global $remove_shortcode; | |
/** | |
* Strips and Removes shortcode if exists | |
* @global int $remove_shortcode | |
* @param type $shortcodes comma seprated string, array of shortcodes | |
* @return content || excerpt | |
*/ | |
function dot1_strip_shortcode( $shortcodes ){ | |
global $remove_shortcode; |
This file contains hidden or 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
//Install required modules, and include them | |
var https = require('https'), // https server | |
http = require('http'), // http server | |
querystring = require('querystring'), | |
url = require('url'); // url parser | |
//URL to which post request will be sent | |
var callback_url = 'http://example.com'; | |
var callback = url.parse(callback_url); |
This file contains hidden or 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 | |
$local_file = 'file_path'; //path to a local file on your server | |
$post_fields = array ( | |
'name' => 'value' | |
); | |
$boundary = wp_generate_password( 24 ); | |
$headers = array( | |
'content-type' => 'multipart/form-data; boundary=' . $boundary | |
); | |
$payload = ''; |
This file contains hidden or 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( 'wxr_export_skip_postmeta', 'skip_smush_meta', '', 2 ); | |
/** | |
* Skip WP Smush meta while exporting | |
* | |
* @param $skip, Whether to skip meta key or not | |
* @param $meta_key, Current meta_key | |
* | |
* @return bool | |
*/ | |
function skip_smush_meta( $skip, $meta_key ) { |
This file contains hidden or 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_filter( 'wp_smush_resize_sizes', 'filter_resize_dimesnsion' ); | |
function filter_resize_dimension( $dimensions ) { | |
$user = wp_get_current_user(); | |
if ( ! empty( $user ) && in_array( 'custom role', (array) $user->roles ) ) { | |
//The user has the "specific admin" role, modify the dimensions | |
$dimensions = array( | |
'width' => 1440, | |
'height' => 1440 | |
); |
This file contains hidden or 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 remove_bulk_smush_page() { | |
if( is_super_admin() ) { | |
return; | |
} | |
remove_submenu_page( 'upload.php', 'wp-smush-bulk' ); | |
} | |
add_action( 'admin_menu', 'remove_bulk_smush_page', 99 ); | |
?> |