Import legacy nurinda.co.id website

This commit is contained in:
dirga committed 2026-10-01 14:27:19 +07:00
1 parent 3f59bb9038
commit 6e21646ac4
13389 files changed
+3246690

No files matched your search

@@ -0,0 +1,124 @@
<?php
/**
* Admin Add-ons
*
* @package MASHSB
* @subpackage Admin/Add-ons
* @copyright Copyright (c) 2014, Rene Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.1.8
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Add-ons
*
* Renders the add-ons content.
*
* @since 1.1.8
* @return void
*/
function mashsb_add_ons_page() {
ob_start(); ?>
<div class="wrap" id="mashsb-add-ons">
<h2>
<?php esc_html_e( 'Add-Ons for MashShare', 'mashsb' ); ?>
&nbsp;&mdash;&nbsp;<a href="https://www.mashshare.net" class="button-primary" title="<?php esc_html_e( 'Visit Website', 'mashsb' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'See Details', 'mashsb' ); ?></a>
</h2>
<p><?php esc_html_e( 'These add-ons extend the functionality of MashShare.', 'mashsb' ); ?></p>
<?php echo mashsbGetAddOns(); ?>
</div>
<?php
echo ob_get_clean();
}
/**
* @return string
*/
function mashsbGetAddOns(){
return <<< EOT
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Add more social networks</h3>
<a title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/mashshare-social-networks-addon/?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/2014/03/mash-networks-e1404756641988.png" alt="MashShare More Networks" width="300" height="200" /></a>Extend MashShare: Whatsapp, Pinterest, Digg, Linkedin, Reddit, Vk,Print, Buffer, Weibo, Pocket, Xing, Tumblr …<a class="button-secondary" title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/mashshare-social-networks-addon/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">VideoPost Popup</h3>
<a title="VideoPost Popup Add-On" href="https://www.mashshare.net/downloads/videopost-popup/?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2015/03/videopost1.png" alt="VideoPost Popup" width="300" height="200" /></a>Share and Like Add-On for Facebook and Twitter which shows an Popup after end of YouTube Video play or read of a story. <a class="button-secondary" title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/videopost-popup/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Floating Sidebar</h3>
<a title="Select and Share Popup Add-On" href="https://www.mashshare.net/downloads/floating-sidebar/?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2016/01/floating.png" alt="Floating Sidebar" width="300" height="200" /></a>Grow your social traffic with this beautiful and powerful sidebar Add-on.<a class="button-secondary" title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/floating-sidebar/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Sticky ShareBar</h3>
<a title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/sticky-sharebar/?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2014/10/sharebar.png" alt="Sticky ShareBar" width="300" height="200" /></a>
Full responsive all time visible ShareBar on top or bottom of your page which slides down after scrolling.<a class="button-secondary" title="Sticky ShareBar" href="https://www.mashshare.net/downloads/sticky-sharebar/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Click To Tweet</h3>
<a title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/click-to-tweet/?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2016/09/product-image-click-to-tweet-300x200.png" alt="Sticky ShareBar" width="300" height="200" /></a>
Create beautiful twitter quotes that drive traffic to your site. Use any text from your post editor and create a twitter quote in seconds.<a class="button-secondary" title="Sticky ShareBar" href="https://www.mashshare.net/downloads/click-to-tweet/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Realtime Pageview Counter</h3>
<a title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/mashshare-pageviews/" target="_blank"><img class="alignnone wp-image-6713 size-medium" src="https://www.mashshare.net/wp-content/uploads/edd/2014/10/pageviews-300x187.png" alt="Pageviews Realtime Counter" width="300" height="187" />
</a>Realtime Pageview Counter - Increase user interaction and interest with this ajax based Pageview Counter.<a class="button-secondary" title="Pageview Counter" href="https://www.mashshare.net/downloads/mashshare-pageviews/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Sticky Facebook LikeBar</h3>
<a title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/facebook-like-bar?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2015/01/fblike.png" alt="MashShare Sticky facebook like bar" width="300" height="200" /></a>
A highly customizable, full responsive and mobile optimized sticky Like-Bar. <a class="button-secondary" title="MashShare Like-Bar" href="https://www.mashshare.net/downloads/facebook-like-bar?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Select and Share</h3>
<a title="Select and Share Popup Add-On" href="https://www.mashshare.net/downloads/select-and-share/?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2015/10/select-and-share.png" alt="VideoPost Popup" width="300" height="200" /></a>Share any text selection via twitter, facebook and mail. Increase sharing of your valuable content. <a class="button-secondary" title="MashShare Networks Add-On" href="https://www.mashshare.net/downloads/select-and-share/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Google Analytics Integration</h3>
<a title="Google Analytics Integration" href="https://www.mashshare.net/downloads/google-analytics-integration/" target="_blank"><img class="alignnone wp-image-4273 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2014/09/google-analytics.png" alt="" width="320" height="200" />
</a>Track and count clicks on all Share Buttons within your Google Analytics account in realtime. <a title="Google Analytics Integration" class="button-secondary" href="https://www.mashshare.net/downloads/google-analytics-integration/" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Add responsive style</h3>
<a href="https://www.mashshare.net/downloads/mashshare-responsive/?ref=1" target="_blank"><img class="alignnone wp-image-494 size-full" src="https://www.mashshare.net/wp-content/uploads/2014/03/mashshare-responsive.png" alt="mashshare-responsive" width="320" height="200" /></a>
Add responsive style to MashShare. <a class="button-secondary" title="MashShare responsive Add-On" href="https://www.mashshare.net/downloads/mashshare-responsive/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">ShortURLs Integration</h3>
<a href="https://www.mashshare.net/downloads/shorturls-integration/" target="_blank"><img class="alignnone wp-image-5207 size-medium" src="https://www.mashshare.net/wp-content/uploads/edd/2014/10/shorturls-300x187.png" alt="shorturls" width="300" height="187" /></a>
Add shortURLs for Twitter. <a class="button-secondary" title="MashShare Shorturls Add-On" href="https://www.mashshare.net/downloads/shorturls-integration/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Like Pop-Up after Share</h3>
<a href="https://www.mashshare.net/downloads/mashshare-likeaftershare/?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2014/08/likeaftershare1.jpg" alt="mash-networks" width="300" height="200" /></a>
Share a post and get a Facebook Like Pop-Up overlay. <a class="button-secondary" title="MashShare LikeAfterShare Add-On" href="https://www.mashshare.net/downloads/mashshare-likeaftershare/?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">Performance Widget</h3>
<a title="MashShare Performance Widget Add-On" href="https://www.mashshare.net/downloads/performance-widget?ref=1" target="_blank"><img class="alignnone wp-image-107 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2015/07/performance.png" alt="MashShare Performance Widget Add-On" width="300" height="200" /></a>
Shares, comments and real time reads at a glance. Give your website a great visual social impact. <a class="button-secondary" title="MashShare Performance Widget Add-On" href="https://www.mashshare.net/downloads/performance-widget?ref=1" target="_blank">Get this Add On</a>
</div>
<div class="mashshare-addons">
<h3 class="mashshare-addons-title">MashShare Open Graph</h3>
<a href="https://www.mashshare.net/downloads/mashshare-open-graph/" target="_blank"><img class="alignnone wp-image-4472 size-full" src="https://www.mashshare.net/wp-content/uploads/edd/2014/09/open-graph.png" alt="" width="320" height="200" /></a>
Share your content in the best possible way. Social sharing optimization with Open Graph implementation.
<a class="button-secondary" title="MashShare Open Graph" href="https://www.mashshare.net/downloads/mashshare-open-graph/" target="_blank">Get this Add On</a>
</div>
EOT;
}
@@ -0,0 +1,79 @@
<?php
/**
* Admin Actions
*
* @package MASHSB
* @subpackage Admin/Actions
* @copyright Copyright (c) 2014, René Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Processes all MASHSB actions sent via POST and GET by looking for the 'mashsb-action'
* request and running do_action() to call the function
*
* @since 1.0
* @return void
*/
function mashsb_process_actions() {
if ( !empty( $_POST['mashsb-action'] ) ) {
do_action( 'mashsb_' . $_POST['mashsb-action'], $_POST );
}
if ( !empty( $_GET['mashsb-action'] ) ) {
do_action( 'mashsb_' . $_GET['mashsb-action'], $_GET );
}
}
add_action( 'admin_init', 'mashsb_process_actions' );
/**
* Arrange order of social network array when it is draged and droped
*
* @global array $mashsb_options
*/
function mashsb_save_order(){
$current_list = get_option('mashsb_networks');
$new_order = (array)$_POST['mashsb_list'];
$new_list = array();
/* First write the sort order */
foreach ($new_order as $n){
if (isset($current_list[$n])){
$new_list[$n] = $current_list[$n];
}
}
/* Update sort order of networks */
update_option('mashsb_networks', $new_list);
die();
}
add_action ('wp_ajax_mashsb_update_order', 'mashsb_save_order');
/**
* Purge the MashShare Cache
*
* @global array $post
* @return bool false
*/
function mashsb_purge_cache(){
global $post;
// Stop WP from update data on autosave
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){
return;
}
if (!isset($post)){
return;
}
update_post_meta($post->ID, 'mashsb_timestamp', '');
}
add_action('save_post', 'mashsb_purge_cache' );
@@ -0,0 +1,37 @@
<?php
/**
* Admin Footer
*
* @package MASHSB
* @subpackage Admin/Footer
* @copyright Copyright (c) 2014, René Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;
/**
* Add rating links to the settings footer
*
* @since 1.0.0
* @return string
*/
function mashsb_admin_rate_us() {
if ( mashsb_is_admin_page() ) {
// $rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Mashshare</a>! Please <a href="%2$s" target="_blank">rate us</a> on <a href="%2$s" target="_blank">WordPress.org</a> and help to support this project.<br>Something not working as expected or need help? Read our <a href="%3$s" target="blank">Documentation</a>', 'mashsb' ),
// 'https://www.mashshare.net',
// 'http://wordpress.org/support/view/plugin-reviews/mashsharer?filter=5#postform',
// 'http://docs.mashshare.net/'
// );
$rate_text = sprintf( __( 'Please do us a BIG favor and give us a 5 star rating <a href="%1$s" target="blank">here.</a> Need help? Read our <a href="%2$s" target="blank">Documentation</a><br>If you`re not happy, please <a href="%3$s" target="blank">get in touch with us</a>, so that we can sort it out. Thank you!', 'mashsb' ),
'http://wordpress.org/support/view/plugin-reviews/mashsharer?filter=5#postform',
'http://docs.mashshare.net/',
'https://www.mashshare.net/contact-developer/'
);
return $rate_text;
}
}
@@ -0,0 +1,405 @@
<?php
/**
* Admin Notices
*
* @package MASHSB
* @subpackage Admin/Notices
* @copyright Copyright (c) 2014, René Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/
// Exit if accessed directly
if( !defined( 'ABSPATH' ) )
exit;
/**
* Check if at least one social network is enabled
*
* @global array $mashsb_options
* @return boolean false when no network is enabled
*/
function mashsb_check_active_networks() {
global $mashsb_options;
$networks = isset( $mashsb_options['networks'] ) ? $mashsb_options['networks'] : false;
if( isset( $networks ) && is_array( $networks ) )
foreach ( $networks as $key => $value ) {
if( isset( $networks[$key]['status'] ) )
return true;
}
return false;
}
/**
* Admin Messages
*
* @since 2.2.3
* @global $mashsb_options Array of all the MASHSB Options
* @return void
*/
function mashsb_admin_messages() {
global $mashsb_options;
if( !current_user_can( 'update_plugins' ) ){
return;
}
mashsb_show_update_notice_gdpr();
// Cache warning
if( mashsb_is_deactivated_cache() ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf(__('Attention: The Mashshare Cache is deactivated. <a href="%s">Activate it</a> or share count requests to social networks will be rate limited.', 'mashsb'), admin_url() . 'admin.php?page=mashsb-settings#mashsb_settingsdebug_header') ). '</p>';
echo '</div>';
}
// Cache warning
if( mashsb_is_deleted_cache() ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf(__('Attention: The Mashshare Cache is permanetely purged. <a href="%s">Fix this</a> or share count requests to social networks will be rate limited.', 'mashsb'), admin_url() . 'admin.php?page=mashsb-settings#mashsb_settingsdebug_header')) . '</p>';
echo '</div>';
}
if( mashsb_is_admin_page() && !mashsb_curl_installed() ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf(__('MashShare needs the PHP extension cURL and curl_multi_init() which is not installed on your server. Please <a href="%s" target="_blank" rel="noopener">install and activate</a> it to be able to collect share count of your posts.', 'mashsb'), 'https://www.google.com/search?btnG=1&pws=0&q=enable+curl+on+php')) . '</p>';
echo '</div>';
}
// notice no Networks enabled
if( mashsb_is_admin_page() && !mashsb_check_active_networks() ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf( __( 'No Social Networks enabled. Go to <a href="%s"> Mashshare->Settings->Social Networks</a> and enable at least one Social Network.', 'mashsb' ), admin_url( 'admin.php?page=mashsb-settings&tab=networks#mashsb_settingsservices_header' ) )) . '</p>';
echo '</div>';
}
// Share bar add-on notice
if( mashsb_is_admin_page() && mashsb_incorrect_sharebar_version() ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf( __( 'Your Sharebar Add-On version is not using new short url mechanism of MashShare 3.X. Please <a href="%s" target="blank"> update the Sharebar Add-On</a> to at least version 1.2.5. if you want to make sure that twitter short urls will not stop working in one of the next updates. This requires a valid license of the Sharebar Add-On', 'mashsb' ), 'https://www.mashshare.net/downloads/sticky-sharebar/?utm_source=insideplugin&utm_medium=userwebsite&utm_content=update_sharebar&utm_campaign=freeplugin' )) . '</p>';
echo '</div>';
}
// Floating Sidebar add-on notice
if( mashsb_is_admin_page() && mashsb_incorrect_sidebar_version() ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf( __( 'Your Floating Sidebar Add-On version is not using new short url mechanism of MashShare 3.X. Please <a href="%s" target="blank"> update the Floating Sidebar Add-On</a> to at least version 1.2.6. if you want to make sure that twitter short urls will not stop working in one of the next updates. This requires a valid license of the Floating Sidebar Add-On', 'mashsb' ), 'https://www.mashshare.net/downloads/floating-sidebar/?utm_source=insideplugin&utm_medium=userwebsite&utm_content=update_sharebar&utm_campaign=freeplugin' ) ). '</p>';
echo '</div>';
}
// Check Bitly API key
if( mashsb_is_admin_page() && (false === mashsb_check_bitly_apikey() && isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'bitly' ) ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf( __( 'Bitly Access Token is invalid or bitly.com endpoint can not be reached. Go to <a href="%s"><i>Mashshare->Settings->Short URL Integration</i></a> and check the Bitly API key.', 'mashsb' ), admin_url( 'admin.php?page=mashsb-settings#mashsb_settingsshorturl_header' ) )) . '</p>';
echo '</div>';
}
// Notice MashShare Open Graph Add-On installed and activated
if( class_exists( 'MashshareOpenGraph' ) ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf( __( '<strong>Important:</strong> Deactivate the MashShare Open Graph Add-On. It is not longer needed and having it activated leads to duplicate open graph tags on your site. Go to <a href="%s"> Plugin Settings</a> ', 'mashsb' ), admin_url( 'plugins.php' ) )) . '</p>';
echo '</div>';
}
// Notice MashShare ShortURL Add-On installed and activated
if( class_exists( 'MashshareShorturls' ) ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf( __( '<strong>Important:</strong> Deactivate the MashShare Shorturls Add-On. It is not longer needed and already built in MashShare. Deactivate it from <a href="%s"> Plugin Settings</a> ', 'mashsb' ), admin_url( 'plugins.php' ) )) . '</p>';
echo '</div>';
}
// Share count is deactivated when permalinks are not used
if( mashsb_is_admin_page() && !mashsb_is_enabled_permalinks() ) {
echo '<div class="error">';
echo '<p>' . wp_kses_post(sprintf( __( '<strong>No Share Count aggregation possible!</strong> <a href="%s">Permalinks</a> must be enabled to count shares. Share count is deactivated until you have changed this.', 'mashsb' ), admin_url( 'options-permalink.php' ) )) . '</p>';
echo '</div>';
}
// Show save notice
if( isset( $_GET['mashsb-message'] ) ) {
switch ( $_GET['mashsb-message'] ) {
case 'settings-imported' :
echo '<div class="updated">';
echo '<p>' . esc_html(__( 'The settings have been imported', 'mashsb' )) . '</p>';
echo '</div>';
break;
}
}
// Please rate us
$install_date = get_option( 'mashsb_installDate' );
$display_date = date( 'Y-m-d h:i:s' );
$datetime1 = new DateTime( $install_date );
$datetime2 = new DateTime( $display_date );
$diff_intrval = round( ($datetime2->format( 'U' ) - $datetime1->format( 'U' )) / (60 * 60 * 24) );
if( $diff_intrval >= 7 && get_option( 'mashsb_RatingDiv' ) == "no" ) {
echo '<div class="mashsb_fivestar update-nag" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);">
<p>Awesome, you\'ve been using <strong>Mashshare Social Sharing Plugin</strong> for more than 1 week. <br> May i ask you to give it a <strong>5-star rating</strong> on Wordpress? </br>
This will help to spread its popularity and to make this plugin a better one.
<br><br>Your help is much appreciated. Thank you very much,<br> ~René Hermenau
<ul>
<li class="float:left"><a href="https://wordpress.org/support/plugin/mashsharer/reviews/?filter=5#new-post" class="thankyou button button-primary" target="_new" title=Yes, MashShare Increased My Shares" style="color: #ffffff;-webkit-box-shadow: 0 1px 0 #256e34;box-shadow: 0 1px 0 #256e34;font-weight: normal;float:left;margin-right:10px;">I Like MashShare - It Increased My Shares</a></li>
<li><a href="javascript:void(0);" class="mashsbHideRating button" title="I already did" style="">I already rated it</a></li>
<li><a href="javascript:void(0);" class="mashsbHideRating" title="No, not good enough" style="">No, not good enough, i do not like to rate it!</a></li>
</ul>
</div>
<script>
jQuery( document ).ready(function( $ ) {
jQuery(\'.mashsbHideRating\').click(function(){
var data={\'action\':\'hideRating\'}
jQuery.ajax({
url: "' . admin_url( 'admin-ajax.php' ) . '",
type: "post",
data: data,
dataType: "json",
async: !0,
success: function(e) {
if (e=="success") {
jQuery(\'.mashsb_fivestar\').slideUp(\'fast\');
}
}
});
})
});
</script>
';
}
}
add_action( 'admin_notices', 'mashsb_admin_messages' );
/**
* Check if sharebar add-on version is fully supported
*
* @return boolean true if incorrect
*/
function mashsb_incorrect_sharebar_version() {
if( defined( 'MASHBAR_VERSION' ) ) {
return version_compare( MASHBAR_VERSION, '1.2.5', '<' );
} else {
return false;
}
}
/**
* Check if sharebar add-on version is fully supported
*
* @return boolean true if incorrect
*/
function mashsb_incorrect_sidebar_version() {
if( defined( 'MASHFS_VERSION' ) ) {
return version_compare(MASHFS_VERSION, '1.1.6', '<');
} else {
return false;
}
}
/* Hide the update notice div
*
* @subpackage Admin/Notices
* @copyright Copyright (c) 2015, René Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 2.4.0
*
* @return json string
*
*/
function mashsb_hide_update_notice() {
$postId = intval($_POST['id'] );
if (!$postId || empty($_POST['action'])) {
return;
}
if( $_POST['action'] === 'mashsb_hide_notice' ) {
update_option( 'mashsb_update_notice_' . $_POST['id'], 'no' );
echo json_encode( array('success') );
exit;
}
}
add_action( 'wp_ajax_mashsb_hide_notice', 'mashsb_hide_update_notice' );
/* Hide the rating div
*
* @subpackage Admin/Notices
* @copyright Copyright (c) 2014, René Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 2.2.3
*
* @return json string
*
*/
function mashsb_HideRatingDiv() {
update_option( 'mashsb_RatingDiv', 'yes' );
echo json_encode( array("success") );
exit;
}
add_action( 'wp_ajax_hideRating', 'mashsb_HideRatingDiv' );
/**
* Admin Add-ons Notices
*
* @since 1.0
* @return void
*/
function mashsb_admin_addons_notices() {
add_settings_error( 'mashsb-notices', 'mashsb-addons-feed-error', __( 'There seems to be an issue with the server. Please try again in a few minutes.', 'mashsb' ), 'error' );
settings_errors( 'mashsb-notices' );
}
/**
* Dismisses admin notices when Dismiss links are clicked
*
* @since 1.8
* @return void
*/
function mashsb_dismiss_notices() {
$notice = isset( $_GET['mashsb_notice'] ) ? esc_attr($_GET['mashsb_notice']) : false;
if( !$notice )
return;
update_user_meta( get_current_user_id(), '_mashsb_' . $notice . '_dismissed', 1 );
wp_save_redirect( esc_url( remove_query_arg( array('mashsb_action', 'mashsb_notice') ) ) );
exit;
}
add_action( 'mashsb_dismiss_notices', 'mashsb_dismiss_notices' );
/*
* Show big colored update information below the official update notification in /wp-admin/plugins
* @since 2.0.8
* @return void
*
*/
function mashsb_in_plugin_update_message( $args ) {
$transient_name = 'mashsb_upgrade_notice_' . $args['Version'];
if( false === ( $upgrade_notice = get_transient( $transient_name ) ) ) {
$response = wp_remote_get( 'https://plugins.svn.wordpress.org/mashsharer/trunk/readme.txt' );
if( !is_wp_error( $response ) && !empty( $response['body'] ) ) {
// Output Upgrade Notice
$matches = null;
$regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( MASHSB_VERSION ) . '\s*=|$)~Uis';
$upgrade_notice = '';
if( preg_match( $regexp, $response['body'], $matches ) ) {
$version = trim( $matches[1] );
$notices = ( array ) preg_split( '~[\r\n]+~', trim( $matches[2] ) );
if( version_compare( MASHSB_VERSION, $version, '<' ) ) {
$upgrade_notice .= '<div class="mashsb_plugin_upgrade_notice" style="padding:10px;background-color:#58C1FF;color: #FFF;">';
foreach ( $notices as $index => $line ) {
$upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}" style="text-decoration:underline;color:#ffffff;">${1}</a>', $line ) );
}
$upgrade_notice .= '</div> ';
}
}
set_transient( $transient_name, $upgrade_notice, DAY_IN_SECONDS );
}
}
echo wp_kses_post( $upgrade_notice );
}
add_action( 'in_plugin_update_message-mashsharer/mashshare.php', 'mashsb_in_plugin_update_message' );
/**
* Get remaining time in seconds of the rate limit transient
* @return type
*/
function mashsbGetRemainingRateLimitTime() {
$trans_time = get_transient( 'timeout_mashsb_rate_limit' );
if( false !== $trans_time ) {
$rest = abs(time() - $trans_time);
if ($rest < 60){
return $rest . ' seconds.';
} else {
$minutes = floor($rest / 60) . ' minutes.';
return $minutes;
}
}
return 0 . 'seconds';
}
/**
* Get the status of the FB api key
* @global array $mashsb_options
* @return mixed boolean | string false if fb api key is valid. String if api key is invalid
*/
function mashsb_is_invalid_fb_api_key(){
global $mashsb_options;
if (empty($mashsb_options['fb_access_token_new'])){
return false;
}
$status = get_option('mashsb_valid_fb_api_key');
if (false === $status || 'success' === $status){
return false;
} else {
return $status;
}
}
/**
* Return update notice for gdpr compliance
* @since 3.5.3.0
*/
function mashsb_show_update_notice_gdpr() {
$message = sprintf(__( '<h2 style="color:white;">MashShare GDPR Compliance</h2>'
. 'MashShare uses sharedcount.com to collect shares and to be GDPR compliant. <br>Activate sharedcount.com here: <a href="'.admin_url().'admin.php?page=mashsb-settings#mashsb_settingsgeneral_header" style="color:white;">MashShare > Settings > General > Share Count</a><br><br>For collecting Twitter shares get the <a href="https://mashshare.net/downloads/mashshare-social-networks-addon/?utm_source=wp-admin&utm_medium=gdpr-notice&utm_campaign=gdpr-notice" target="_blank" style="color:white;text-decoration:underline;">Social Network Add-On</a>'
, 'mashsb' ),
admin_url() . 'admin.php?page=mashsb-settings'
);
if( get_option( 'mashsb_show_update_notice_gdpr1' ) === 'no' ) {
return false;
}
// admin notice after updating Mashshare
$html = '<div class="mashsb-notice-gdpr mashsb_update_notice_gdpr update-nag" style="background-color: #00abed;color: white;padding: 20px;margin-top: 20px;border: 3px solid white;width:80%;">' . $message .
'<p><a href="'.admin_url().'admin.php?page=mashsb-settings&mashsb-action=hide_gdpr_notice" class="mashsb_hide_gdpr" title="I got it" style="text-decoration:none;color:white;text-decoration:none;">I understand! Close this message</a></a>'.
'</div>';
echo wp_kses_post($html);
}
/**
* Hide GDPR notice
*
* @global array $mashsb_options
*/
function mashsb_hide_gdpr_notice(){
update_option( 'mashsb_show_update_notice_gdpr1', 'no' );
}
add_action ('mashsb_hide_gdpr_notice', 'mashsb_hide_gdpr_notice');
/**
* Hide FB API notice
*
* @global array $mashsb_options
*/
function mashsb_hide_fb_api_notice(){
update_option( 'mashsb_show_new_fb_api', 'no' );
}
add_action ('mashsb_hide_fb_api_notice', 'mashsb_hide_fb_api_notice');
@@ -0,0 +1,57 @@
<?php
/**
* Admin Pages
*
* @package MASHSB
* @subpackage Admin/Pages
* @copyright Copyright (c) 2014, René Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 2.0
*/
// Exit if accessed directly
if( !defined( 'ABSPATH' ) )
exit;
/**
* Creates the admin submenu pages under the Mashshare menu and assigns their
* links to global variables
*
* @since 1.0
* @global $mashsb_settings_page
* @global $mashsb_add_ons_page
* @global $mashsb_tools_page
* @return void
*/
function mashsb_add_options_link() {
global $mashsb_parent_page, $mashsb_add_ons_page, $mashsb_settings_page, $mashsb_tools_page, $mashsb_quickstart;
$mashshare_logo = 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIGZpbGw9Im5vbmUiIHdpZHRoPSI1MDBweCIgaGVpZ2h0PSI1MDBweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiPg0KPGc+DQoJPHBhdGggc3R5bGU9ImZpbGw6I2ZmZiIgZD0iTTIuOSw0OGgxNDZsMTAxLjMsMjM4TDM1Mi4xLDQ4aDE0NS43djQ0NC44SDM4OS4zVjE2Ny41TDI4Ni44LDQwNy4zaC03Mi43TDExMS42LDE2Ny41djMyNS4zSDIuOVY0OHoiLz4NCjwvZz4NCjwvc3ZnPg==';
// Getting Started Page
$mashsb_parent_page = add_menu_page( 'Mashshare Settings', __( 'MashShare', 'mashsb' ), 'manage_options', 'mashsb-settings', 'mashsb_options_page', 'data:image/svg+xml;base64,' . $mashshare_logo);
$mashsb_settings_page = add_submenu_page( 'mashsb-settings', __( 'MashShare Settings', 'mashsb' ), __( 'Settings', 'mashsb' ), 'manage_options', 'mashsb-settings', 'mashsb_options_page' );
$mashsb_add_ons_page = add_submenu_page( 'mashsb-settings', __( 'MashShare Add-Ons', 'mashsb' ), '<span style="color:#f18500">' . __( 'Install Add-Ons', 'mashsb' ) . '</span>', 'manage_options', 'mashsb-addons', 'mashsb_add_ons_page' );
$mashsb_tools_page = add_submenu_page( 'mashsb-settings', __( 'MashShare Tools', 'mashsb' ), __( 'Im/Export & System', 'mashsb' ), 'manage_options', 'mashsb-tools', 'mashsb_tools_page' );
}
add_action( 'admin_menu', 'mashsb_add_options_link', 10 );
/**
* Determines whether the current admin page is an MASHSB admin page.
*
* Only works after the `wp_loaded` hook, & most effective
* starting on `admin_menu` hook.
*
* @since 1.9.6
* @return bool True if MASHSB admin page.
*/
function mashsb_is_admin_page() {
$currentpage = isset( $_GET['page'] ) ? $_GET['page'] : '';
if( !is_admin() || !did_action( 'wp_loaded' ) ) {
return false;
}
if( 'mashsb-settings' == $currentpage || 'mashsb-addons' == $currentpage || 'mashsb-tools' == $currentpage || 'mashsb-getting-started' == $currentpage || 'mashsb-about' == $currentpage ) {
return true;
}
}
@@ -0,0 +1,74 @@
<?php
/**
* Admin Dashboard
*
* @package MASHSB
* @subpackage Admin/Dashboard
* @copyright Copyright (c) 2016, Rene Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Add new columns in posts dashboard
*
* @return string
*/
function mashsb_create_share_columns($col) {
$col['mashsb_shares'] = 'Share Count';
return $col;
}
add_filter('manage_posts_columns', 'mashsb_create_share_columns');
/**
* Get share count in post columns
*
* @param array $col
* @param int $post_id
* @retrun int
*/
function mashsb_get_shares($col, $post_id) {
if ($col == 'mashsb_shares') {
$shares = get_post_meta($post_id,'mashsb_shares',true);
echo (int)$shares;
}
}
add_action('manage_posts_custom_column', 'mashsb_get_shares', 10, 2);
/**
* Make share count columns sortable
*
* @param array $col
* @return string
*/
// Make the column Sortable
function mashsb_share_column_sortable( $col ) {
$col['mashsb_shares'] = 'Share Count';
return $col;
}
add_filter('manage_edit-post_sortable_columns', 'mashsb_share_column_sortable');
/**
* Change columns get_posts() query
*
* @param type $query
* @return void
*/
function mashsb_sort_shares_by( $query ) {
if( ! is_admin() ){
return false;
}
$orderby = $query->get( 'orderby');
if( 'Share Count' == $orderby ) {
$query->set('meta_key','mashsb_shares');
$query->set('orderby','meta_value_num');
}
}
add_action( 'pre_get_posts', 'mashsb_sort_shares_by' );
@@ -0,0 +1,89 @@
<?php
/**
* Feedback functions
*
* @package MASHSB
* @subpackage Admin/Feedback
* @copyright Copyright (c) 2017, René Hermenau
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.3.7
*/
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;
/**
* Helper method to check if user is in the plugins page.
*
* @author René Hermenau
* @since 3.3.7
*
* @return bool
*/
function mashsb_is_plugins_page() {
global $pagenow;
return ( 'plugins.php' === $pagenow );
}
/**
* display deactivation logic on plugins page
*
* @since 3.3.7
*/
function mashsb_add_deactivation_feedback_modal() {
$screen = get_current_screen();
if( !is_admin() && !mashsb_is_plugins_page()) {
return;
}
$current_user = wp_get_current_user();
if( !($current_user instanceof WP_User) ) {
$email = '';
} else {
$email = trim( $current_user->user_email );
}
include MASHSB_PLUGIN_DIR . 'includes/admin/views/deactivate-feedback.php';
}
/**
* send feedback via email
*
* @since 1.4.0
*/
function mashsb_send_feedback() {
if( isset( $_POST['data'] ) ) {
parse_str( $_POST['data'], $form );
}
$text = '';
if( isset( $form['mashsb_disable_text'] ) ) {
$text = implode( "\n\r", $form['mashsb_disable_text'] );
}
$headers = array();
$from = isset( $form['mashsb_disable_from'] ) ? $form['mashsb_disable_from'] : '';
if( $from ) {
$headers[] = "From: $from";
$headers[] = "Reply-To: $from";
}
$subject = isset( $form['mashsb_disable_reason'] ) ? $form['mashsb_disable_reason'] : '(no reason given)';
$success = wp_mail( 'makebetter@mashshare.net', $subject, $text, $headers );
if ($success){
wp_die(1);
}
wp_die(0);
//error_log(print_r($success, true));
//error_log($from . $subject . var_dump($form));
die();
}
add_action( 'wp_ajax_mashsb_send_feedback', 'mashsb_send_feedback' );
@@ -0,0 +1,14 @@
.mashsb-rwmb-autocomplete-result {
border-bottom: 1px solid #ccc;
padding: 1em 0;
overflow: hidden;
}
.mashsb-rwmb-autocomplete-result .label {
float: left;
width: 90%;
}
.mashsb-rwmb-autocomplete-result .actions {
width: 10%;
float: right;
cursor: pointer;
}
@@ -0,0 +1,4 @@
.mashsb-rwmb-checkbox-wrapper .description {
display: inline;
font-style: normal;
}
@@ -0,0 +1,7 @@
.mashsb-rwmb-color-wrapper .wp-picker-container {
position: relative;
}
.mashsb-rwmb-color-wrapper .wp-picker-holder {
position: absolute;
z-index: 9;
}
@@ -0,0 +1,231 @@
/* Fix empty block below admin footer (issue #24) */
#ui-datepicker-div {
display: none;
z-index: 9 !important;
}
/* Style for multiple months */
.ui-datepicker-multi .ui-datepicker-group {
padding: 0 .5%;
box-sizing: border-box;
}
.ui-datepicker-multi .ui-datepicker-group .ui-datepicker-calendar {
width: 100%;
}
/* Date Picker Default Styles */
.ui-datepicker {
padding: 0;
border: 1px solid #ddd;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.ui-datepicker * {
padding: 0;
font-family: "Open Sans", sans-serif;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.ui-datepicker table {
font-size: 13px;
margin: 0;
}
.ui-datepicker .ui-datepicker-header,
.ui-timepicker-div .ui-widget-header{
border: none;
background: #23282d;
color: #fff;
font-weight: normal;
}
.ui-datepicker .ui-datepicker-header .ui-state-hover {
background: #23282d;
border-color: transparent;
cursor: pointer;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.ui-datepicker thead {
background: #23282d;
color: #fff;
}
.ui-datepicker .ui-datepicker-title {
margin-top: .4em;
margin-bottom: .3em;
color: #fff;
font-size: 14px;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover,
.ui-datepicker .ui-datepicker-next,
.ui-datepicker .ui-datepicker-prev {
height: 1em;
top: .9em;
border: none;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 2px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 2px;
}
.ui-datepicker .ui-datepicker-next span,
.ui-datepicker .ui-datepicker-prev span {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAAEgAAABIAEbJaz4AABe4SURBVHja7V1diCXHdf56vbZmVl6nxwKFO2yyq1mM4qAwM7oDsR6C7iYIKesH3V1Q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M8b+C+Vb5lVDD3FJCWRecJYidghsccuesih8P8Pi73ggIpI3uKPsxv/LbpQ3qKIcBVGtXj+ibvNqh+H8rfg0qTlmXzmxTYqkld07plORFRz2GcLvKR0/yux8CKAqkl9nPl9+dqsa09kK87eB3v+gWM6IgBoHvsx4QRAOCWeTrOBwgc0RcQOCIBAkckQOCIBAgc4REgcxsPGMmgfDZ61EOPbTfFOburVgmwXlbAemt9NLUqSEHYyb/vwDar4Vq+qHS3RoHfxy4u4zI+hU/hh/h0LWZWO1fzX9mepeq+55v4LAhP4AkQPovNWnx5+4ph7cF+6JC7QgxraRgjQObZdSLapSEN6ZAqpwc34CENZpAzRPtjlOdrnR1UybBDoB1rLorhkHPsUNep8vgYOxa6Q8M8B5meAZO+fRyv8FKklmEw+UwVO7XoycYa+7k3B0z51BjrxXc1QDZKvENEh1YjTpMAxVgWn0Zh9uqzrLine truncated
background-position: -32px 0;
margin-top: 0;
top: 0;
font-weight: normal;
}
.ui-datepicker .ui-datepicker-prev span {
background-position: -96px 0;
}
.ui-datepicker th {
padding: 0.75em 0;
color: #fff;
font-weight: normal;
border: none;
border-top: 1px solid #32373c;
}
.ui-datepicker td {
background: #f1f1f1;
border: none;
padding: 0;
}
.ui-datepicker td .ui-state-default {
background: transparent;
border: none;
text-align: center;
padding: .5em;
margin: 0;
font-weight: normal;
color: #32373c;
}
.ui-datepicker td .ui-state-active,
.ui-datepicker td .ui-state-hover {
background: #0073aa;
color: #fff;
}
.ui-datepicker td.ui-state-disabled,
.ui-datepicker td.ui-state-disabled .ui-state-default {
opacity: 1;
color: #999;
}
/* Other Datepicker Color Schemes */
/* Blue */
.admin-color-blue .ui-datepicker .ui-datepicker-header,
.admin-color-blue .ui-timepicker-div .ui-widget-header,
.admin-color-blue .ui-datepicker .ui-datepicker-header .ui-state-hover,
.admin-color-blue .ui-datepicker thead {
background: #4796b3;
}
.admin-color-blue .ui-datepicker th {
border-color: #52accc;
}
.admin-color-blue .ui-datepicker td .ui-state-active,
.admin-color-blue .ui-datepicker td .ui-state-hover {
background: #096484;
}
/* Coffee */
.admin-color-coffee .ui-datepicker .ui-datepicker-header,
.admin-color-cofee .ui-timepicker-div .ui-widget-header,
.admin-color-coffee .ui-datepicker .ui-datepicker-header .ui-state-hover,
.admin-color-coffee .ui-datepicker thead {
background: #46403c;
}
.admin-color-coffee .ui-datepicker th {
border-color: #59524c;
}
.admin-color-coffee .ui-datepicker td .ui-state-active,
.admin-color-coffee .ui-datepicker td .ui-state-hover {
background: #c7a589;
}
/* Ectoplasm */
.admin-color-ectoplasm .ui-datepicker .ui-datepicker-header,
.admin-color-ectoplasm .ui-timepicker-div .ui-widget-header,
.admin-color-ectoplasm .ui-datepicker .ui-datepicker-header .ui-state-hover,
.admin-color-ectoplasm .ui-datepicker thead {
background: #413256;
}
.admin-color-ectoplasm .ui-datepicker th {
border-color: #523f6d;
}
.admin-color-ectoplasm .ui-datepicker td .ui-state-active,
.admin-color-ectoplasm .ui-datepicker td .ui-state-hover {
background: #a3b745;
}
/* Midnight */
.admin-color-midnight .ui-datepicker .ui-datepicker-header,
.admin-color-midnight .ui-timepicker-div .ui-widget-header,
.admin-color-midnight .ui-datepicker .ui-datepicker-header .ui-state-hover,
.admin-color-midnight .ui-datepicker thead {
background: #26292c;
}
.admin-color-midnight .ui-datepicker th {
border-color: #363b3f;
}
.admin-color-midnight .ui-datepicker td .ui-state-active,
.admin-color-midnight .ui-datepicker td .ui-state-hover {
background: #e14d43;
}
/* Ocean */
.admin-color-ocean .ui-datepicker .ui-datepicker-header,
.admin-color-ocean .ui-timepicker-div .ui-widget-header,
.admin-color-ocean .ui-datepicker .ui-datepicker-header .ui-state-hover,
.admin-color-ocean .ui-datepicker thead {
background: #627c83;
}
.admin-color-ocean .ui-datepicker th {
border-color: #738e96;
}
.admin-color-ocean .ui-datepicker td .ui-state-active,
.admin-color-ocean .ui-datepicker td .ui-state-hover {
background: #9ebaa0;
}
/* Sunrise */
.admin-color-sunrise .ui-datepicker .ui-datepicker-header,
.admin-color-sunrise .ui-timepicker-div .ui-widget-header,
.admin-color-sunrise .ui-datepicker .ui-datepicker-header .ui-state-hover,
.admin-color-sunrise .ui-datepicker thead {
background: #be3631;
}
.admin-color-sunrise .ui-datepicker th {
border-color: #cf4944;
}
.admin-color-sunrise .ui-datepicker td .ui-state-active,
.admin-color-sunrise .ui-datepicker td .ui-state-hover {
background: #dd823b;
}
/* Light */
.admin-color-light .ui-datepicker .ui-datepicker-header,
.admin-color-light .ui-timepicker-div .ui-widget-header,
.admin-color-light .ui-datepicker .ui-datepicker-header .ui-state-hover,
.admin-color-light .ui-datepicker thead {
background: #e5e5e5;
}
.admin-color-light .ui-datepicker td {
background: #fff;
}
.admin-color-light .ui-datepicker .ui-datepicker-next span,
.admin-color-light .ui-datepicker .ui-datepicker-prev span {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAYAAADvl7rLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0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G1LxD8h2xuVvoRuSznoq/r6Ka+xwNMc7/Line truncated
}
.admin-color-light .ui-datepicker th {
border-color: #fff;
}
.admin-color-light .ui-datepicker .ui-datepicker-title,
.admin-color-light .ui-datepicker td .ui-state-default,
.admin-color-light .ui-datepicker th {
color: #555;
}
.admin-color-light .ui-datepicker td .ui-state-active,
.admin-color-light .ui-datepicker td .ui-state-hover {
color: #fff;
background: #888;
}
.admin-color-light .ui-datepicker td.ui-state-disabled,
.admin-color-light .ui-datepicker td.ui-state-disabled .ui-state-default {
color: #ccc;
}
@@ -0,0 +1,7 @@
/* =Styles for 'divider' field
-------------------------------------------------------------- */
.mashsb-rwmb-divider-wrapper hr {
border: none;
border-top: 1px solid #e6e6e6;
}
@@ -0,0 +1,58 @@
.mashsb-rwmb-file li {
width: 250px;
margin: 0 10px 10px 0;
-webkit-transition: width .25s, opacity .25s, -webkit-opacity .25s;
transition: width .25s, opacity .25s;
}
.mashsb-rwmb-file .mashsb-rwmb-icon {
width: 60px;
text-align: center;
vertical-align: middle;
overflow: hidden;
}
.mashsb-rwmb-file .mashsb-rwmb-icon img {
max-height: 60px;
max-width: 60px;
}
.mashsb-rwmb-file .mashsb-rwmb-info {
width: 180px;
vertical-align: top;
overflow: hidden;
}
.mashsb-rwmb-file .mashsb-rwmb-info p {
margin: .1em 0;
}
.mashsb-rwmb-file .mashsb-rwmb-info a {
font-weight: bold;
text-decoration: none;
}
.mashsb-rwmb-file li,
.mashsb-rwmb-file .mashsb-rwmb-icon,
.mashsb-rwmb-file .mashsb-rwmb-info {
display: inline-block;
}
.mashsb-rwmb-file .mashsb-rwmb-icon,
.mashsb-rwmb-file .mashsb-rwmb-info {
margin: 0 0 2px 2px;
}
.mashsb-rwmb-file li.removed {
width: 0;
margin: 0;
opacity: 0;
-webkit-opacity: 0;
-moz-opacity: 0;
-o-opacity: 0;
}
.mashsb-rwmb-file li.removed:after {
content: ' ';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
opacity: .4;
background-color: #f00;
}
@@ -0,0 +1,12 @@
/* =Styles for 'heading' field
-------------------------------------------------------------- */
.mashsb-rwmb-heading-wrapper h4 {
display: block;
font-size: .75rem;
line-height: 1.4;
border-bottom: 1px solid rgb(230, 230, 230);
text-transform: uppercase;
padding: .75rem 0 .375rem;
margin: 0 0 6px;
}
@@ -0,0 +1,43 @@
/* Image */
.mashsb-rwmb-image-item {
position: relative;
float: left;
padding: 0;
margin: 0 5px 5px 0;
box-sizing: border-box;
width: 150px;
}
.mashsb-rwmb-image-item .mashsb-rwmb-media-preview {
width: 150px;
}
.mashsb-rwmb-image-item .dashicons {
font-size: 20px;
width: 20px;
height: 20px;
}
.mashsb-rwmb-media-bar {
position: absolute;
z-index: 10;
display: none;
right: 5px;
top: 5px;
color: #fff;
}
.mashsb-rwmb-media-bar a {
text-decoration: none;
color: inherit;
}
.mashsb-rwmb-overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, .6);
display: none;
}
.mashsb-rwmb-image-item:hover .mashsb-rwmb-media-bar,
.mashsb-rwmb-image-item:hover .mashsb-rwmb-overlay {
display: block;
cursor: move;
}
@@ -0,0 +1,21 @@
.mashsb-rwmb-image-select {
display: inline-block;
width: 80px;
height: 80px;
float: left;
margin: 0 10px 10px 0;
border: 3px solid #d8d8d8;
border-radius: 3px;
padding: 1px;
}
.mashsb-rwmb-image-select img {
width: 100%;
height: 100%;
}
.mashsb-rwmb-image-select:hover,
.mashsb-rwmb-image-select.mashsb-rwmb-active {
border-color: #0074a2;
}
.mashsb-rwmb-image-select input {
display: none;
}
@@ -0,0 +1,67 @@
/* Uploaded image */
.mashsb-rwmb-images {
overflow: hidden;
}
.mashsb-rwmb-images li {
margin: 0 10px 10px 0;
float: left;
width: 150px;
height: 150px;
text-align: center;
cursor: move;
position: relative;
-webkit-transition: width .25s, opacity .25s, -webkit-opacity .25s;
transition: width .25s, opacity .25s;
}
.mashsb-rwmb-images img {
width: 150px;
height: 150px;
}
.mashsb-rwmb-image-bar {
color: #fff;
font-weight: bold;
background: #000;
background: rgba(0, 0, 0, .5);
position: absolute;
top: 0;
right: 0;
padding: 5px;
display: none;
text-align: center;
}
li:hover .mashsb-rwmb-image-bar {
display: block;
}
.mashsb-rwmb-image-bar a {
color: #fff;
font-weight: bold;
text-decoration: none;
vertical-align: middle;
}
.mashsb-rwmb-image-bar a.mashsb-rwmb-delete-file {
font-size: 23px;
width: 18px;
font-weight: normal;
}
.mashsb-rwmb-images li.removed {
width: 0;
margin: 0;
opacity: 0;
-webkit-opacity: 0;
-moz-opacity: 0;
-o-opacity: 0;
}
.mashsb-rwmb-images li.removed:after {
content: ' ';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
opacity: .4;
background-color: #f00;
}
.mashsb-rwmb-images li.ui-state-highlight {
background: #ddd;
}
@@ -0,0 +1,7 @@
.mashsb-rwmb-input-list li{
line-height: 22px;
}
li .mashsb-rwmb-input-list {
margin-left: 15px;
}
@@ -0,0 +1,5 @@
/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2014 Trent Richardson; Licensed MIT */
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}
@@ -0,0 +1,38 @@
/*
* jQuery UI CSS Framework 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
.ui-helper-clearfix:after { clear: both; }
.ui-helper-clearfix { zoom: 1; }
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
@@ -0,0 +1,68 @@
/*
* jQuery UI Datepicker 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}
@@ -0,0 +1,24 @@
/*
* jQuery UI Slider 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Slider#theming
*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }
@@ -0,0 +1,249 @@
/*
* jQuery UI CSS Framework 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../../img/jqueryui/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(../../img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
.ui-widget-header a { color: #222222; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(../../img/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(../../img/jqueryui/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(../../img/jqueryui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(../../img/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(../../img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(../../img/jqueryui/ui-icons_222222_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(../../img/jqueryui/ui-icons_222222_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(../../img/jqueryui/ui-icons_222222_256x240.png); }
.ui-state-default .ui-icon { background-image: url(../../img/jqueryui/ui-icons_888888_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../../img/jqueryui/ui-icons_454545_256x240.png); }
.ui-state-active .ui-icon {background-image: url(../../img/jqueryui/ui-icons_454545_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(../../img/jqueryui/ui-icons_2e83ff_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../../img/jqueryui/ui-icons_cd0a0a_256x240.png); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(../../img/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(../../img/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
@@ -0,0 +1,4 @@
.mashsb-rwmb-map-canvas {
width: 100%;
height: 400px;
}
@@ -0,0 +1,81 @@
.mashsb-rwmb-media-list {
margin: 0 0 5px;
overflow: hidden;
}
.mashsb-rwmb-media-item {
overflow: hidden;
margin-bottom: 10px;
}
.mashsb-rwmb-media-preview {
width: 60px;
float: left;
position: relative;
}
.mashsb-rwmb-media-preview:before {
content: '';
display: block;
padding-top: 100%;
}
.mashsb-rwmb-media-content {
position: absolute;
overflow: hidden;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.mashsb-rwmb-media-content .centered {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-webkit-transform: translate(50%, 50%);
-ms-transform: translate(50%, 50%);
transform: translate(50%, 50%);
}
.mashsb-rwmb-media-content img {
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
max-height: 100%;
max-width: 100%;
border-radius: 3px;
}
.mashsb-rwmb-media-info {
margin-left: 65px;
}
.mashsb-rwmb-media-info a {
text-decoration: none;
}
.mashsb-rwmb-media-info p,
.mashsb-rwmb-media-info h4 {
margin: 0 0 2px;
}
.mashsb-rwmb-edit-media,
.mashsb-rwmb-remove-media {
font-size: 11px;
color: inherit;
}
.mashsb-rwmb-edit-media .dashicons,
.mashsb-rwmb-remove-media .dashicons {
font-size: 12px;
width: 12px;
height: 12px;
vertical-align: middle;
}
/* Add more button */
.mashsb-rwmb-media-view .mashsb-rwmb-add-media {
padding-left: 5px;
margin-right: 5px;
}
/* Status */
.mashsb-rwmb-media-status {
display: inline-block;
text-decoration: none;
font-size: 13px;
line-height: 26px;
height: 28px;
}
@@ -0,0 +1,11 @@
.mashsb-rwmb-oembed-wrapper .spinner {
float: none;
vertical-align: top;
display: inline-block;
}
.mashsb-rwmb-oembed-wrapper .embed-code {
margin-top: 1em;
}
.mashsb-rwmb-oembed-wrapper .embed-code iframe {
max-width: 100%;
}
@@ -0,0 +1,25 @@
div.mashsb-rwmb-drag-drop {
border: 4px dashed #ddd;
height: 200px;
}
div.mashsb-rwmb-image-uploading-bar {
position: absolute;
width: 100%;
height: 0;
bottom: 0;
}
div.mashsb-rwmb-image-uploading-status {
position: absolute;
}
li.mashsb-rwmb-image-error {
border: 3px solid #c00;
background: #903838;
}
.mashsb-rwmb-image-uploading-status .mashsb-rwmb-loader {
width: 64px;
height: 64px;
top: 43px;
left: 43px;
position: relative;
}
@@ -0,0 +1,13 @@
input[type='range'] {
vertical-align: middle;
border-radius: 2px;
border: 1px solid #dfdfdf;
}
.mashsb-rwmb-output {
display: inline-block;
position: relative;
padding: 5px 10px;
line-height: 20px;
}
@@ -0,0 +1,8 @@
.mashsb-rwmb-field .select2-container {
height: auto;
min-width: 200px;
}
#post-body .mashsb-rwmb-select-all {
margin-top: 5px;
}
@@ -0,0 +1,7 @@
.mashsb-rwmb-select-tree {
display: inline-block;
}
.mashsb-rwmb-select-tree.hidden {
display: none;
}
@@ -0,0 +1,4 @@
.mashsb-rwmb-select-all-none {
display: block;
margin-top: 5px;
}
@@ -0,0 +1,483 @@
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
}
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-selection--single .select2-selection__clear {
position: relative; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--multiple .select2-selection__rendered {
/*display: inline-block;*/
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-search--inline {
float: left; }
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0; }
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051; }
.select2-results {
display: block; }
.select2-results__options {
list-style: none;
margin: 0;
padding: 0; }
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
.select2-results__option[aria-selected] {
cursor: pointer; }
.select2-container--open .select2-dropdown {
left: 0; }
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-search--dropdown {
display: block;
padding: 4px; }
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-search--dropdown.select2-search--hide {
display: none; }
.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0); }
.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important; }
.select2-container--default .select2-selection--single {
background-color: #fff;
border: 1px solid #aaa;
border-radius: 4px; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left; }
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa; }
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield; }
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--default .select2-results__option[role=group] {
padding: 0; }
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; }
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white; }
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 4px;
outline: 0;
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px; }
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
border-left: 1px solid #aaa;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
border-right: 1px solid #aaa;
border-radius: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
left: 1px;
right: auto; }
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
background: transparent;
border: none; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;
outline: 0; }
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0; }
.select2-container--classic .select2-search--inline .select2-search__field {
outline: 0;
box-shadow: none; }
.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }
.select2-container--classic .select2-dropdown--above {
border-bottom: none; }
.select2-container--classic .select2-dropdown--below {
border-top: none; }
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--classic .select2-results__option[role=group] {
padding: 0; }
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb; }
@@ -0,0 +1,13 @@
.mashsb-rwmb-slider {
display: inline-block;
vertical-align: middle;
width: 50%;
}
.mashsb-rwmb-slider-value-label {
margin-left: 10px;
vertical-align: middle;
}
/* Fix slider handle being visible through jQuery panel */
.ui-slider .ui-slider-handle {
z-index: 1;
}
@@ -0,0 +1,7 @@
.mashsb-rwmb-label, .mashsb-rwmb-input{
float: right;
}
label.error{
padding-left: auto;
padding-right: 3px;
}
@@ -0,0 +1,327 @@
/* =Styles for 'normal' meta boxes
-------------------------------------------------------------- */
/* Clearfix for field */
.mashsb-rwmb-field:before,
.mashsb-rwmb-field:after {
content: " ";
display: table;
}
.mashsb-rwmb-field:after {
clear: both;
}
.mashsb-rwmb-field {
*zoom: 1;
margin: 0px;
}
.mashsb-rwmb-label,
.mashsb-rwmb-input {
vertical-align: top;
float: left;
}
.mashsb-rwmb-label.required > span {
color: #c00;
font-weight: bold;
}
/* 75% if field has label, 100% if no label */
.mashsb-rwmb-input {
width: 100%;
}
.mashsb-rwmb-label ~ .mashsb-rwmb-input {
width: 75%;
}
.mashsb-rwmb-input h4 {
margin: 0;
}
.mashsb-rwmb-textarea {
resize: vertical;
}
/* Clone */
.mashsb-rwmb-clone {
min-height: 24px;
margin-bottom: 10px;
position: relative;
clear: both;
background: #fff;
}
.mashsb-rwmb-clone > input[type='radio'],
.mashsb-rwmb-clone > input[type='checkbox'] {
margin: 6px 0 0 4px;
}
.mashsb-rwmb-button.remove-clone {
text-decoration: none;
color: #fff;
background: #c00;
border-radius: 50%;
display: inline-block;
position: absolute;
top: 0;
right: 0;
}
.remove-clone:focus {
outline: 0;
box-shadow: none;
}
.mashsb-rwmb-button.add-clone {
margin-top: 5px;
}
.mashsb-rwmb-clone-icon {
cursor: move;
background: url(../img/drag_icon.gif) no-repeat;
height: 23px;
width: 15px;
vertical-align: top;
display: inline-block;
position: absolute;
left: 0;
top: 0;
}
.mashsb-rwmb-clone-placeholder {
background: #fcf8e3;
border: 1px solid #faebcc;
display: block;
}
.mashsb-rwmb-sort-clone {
padding-left: 15px;
}
/* jQuery validation */
label.error {
padding-left: 3px;
color: red;
}
input.error,
textarea.error,
select.error {
border-color: #c00 !important;
background: #ffebe8 !important;
}
/* =Styles for 'side' meta boxes
-------------------------------------------------------------- */
#side-sortables .mashsb-rwmb-label,
#side-sortables .mashsb-rwmb-input {
width: 100%;
}
/* Mashshare Custom Settings
-------------------------------------------------------------- */
#mashsb_meta .mashsb-rwmb-field.mashsb-rwmb-image_advanced-wrapper.mashsb-og-image .mashsb-rwmb-input ul{
min-height:10px;
}
.mashsb-rwmb-meta-box {
margin-left:10px;
}
@font-face {
font-family: 'mashsb-font';
src: url('data:application/octet-stream;base64,d09GRgABAAAAACaQAA8AAAAAONAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADMAAABCsP6z7U9TLzIAAAGMAAAAQwAAAFY+J0mTY21hcAAAAdAAAADdAAADIvCz7sVjdnQgAAACsAAAAAoAAAAKAAAAAGZwZ20AAAK8AAAFlAAAC3CIkJBZZ2FzcAAACFAAAAAIAAAACAAAABBnbHlmAAAIWAAAGjUAACJyew1QUmhlYWQAACKQAAAAMwAAADYKU1hvaGhlYQAAIsQAAAAgAAAAJAhtBKhobXR4AAAi5AAAAFEAAACEf/j/+GxvY2EAACM4AAAARAAAAER6RoMNbWF4cAAAI3wAAAAgAAAAIADDDJZuYW1lAAAjnAAAAYUAAALxsr4kP3Bvc3QAACUkAAABAgAAAWeITjDCcHJlcAAAJigAAABlAAAAe91rA4V4nGNgZGBg4GKQY9BhYHRx8wlh4GBgYYAAkAxjTmZ6IlAMygPKsYBpDiBmg4gCAIojA08AeJxjYGR+yDiBgZWBgamKaQ8DA0MPhGZ8wGDIyAQUZWBlZsAKAtJcUxgcXjC8kGcO+p/FEMUcxjAXKMwIkgMACuAMOAB4nO3SYU4CMRiE4XehICiiIoqAyh7AQ3kgfxhPObeA+c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OAgcGIyInLgInJi8BLgIKHQsJCg4WCgYgEBoKFAwGDgoMBCY4BwUICgoMCgccAwEPBhIgBw5IPE8aARYUFAgJAgEDBAMCBBoJEAcLBBIBLy8JDAwPEBYJFBogDwkTIA0iEAYDIxEiOggCGAoOAgYHCgMKDEdRMxobFRYUERoTBkJJBBoSHA0XDgQIDUIcJk5+TCtoXRcECgYCjggIAQECAQECBgMUEiAGUlELCAgQBgoCAQVwExBKHAsOCgUcEgMGCQkFEhgHBxQgKgoXFxIULBEBBggMBBgCPmUXGhoMEwcCAgECAQQICQYHHTodLkYMAiAQHA0IDggMBAkLQWgXIQgEAwIFC1MEIhASAwQyRA8YBAhASDiFvTAIIBgAAAAABgAA/5IDrQMqABsAHwAoACwAMAA0ABFADjMxLy0rKSQgHRwXCQYtKwEyFhURFAYrARchNyMiJjURNDY7ATUzNSEVMxUlESERATI2NCYiBhQWEyEnIRcjNTMXIzUzA2IeLS0eTCL9TRtSIS0tIWAiAg8i/fIByf3GFyAhLCAgVQI3L/4c2IuLxouLAjQuIP6SHy6ZmS0gAW4hLXWBgXXH/twBJP57ICsgICsg/krygSMjIwAAAgAA/2oD8QNSAAMABwAItQUEAQACLSsVESERExEhEQH1CAH0lgH1/gsB8wLine truncated
}
.mashicon-share:before {
font-family: 'mashsb-font';
content: '\e81E';
}
.mashicon-pinterest:before {
font-family: 'mashsb-font';
content: '\e802';
}
.mashicon-twitter:before {
font-family: 'mashsb-font';
content: '\e807';
}
.mashsb-rwmb-label label {
font-weight: bold;
color: #363636;
font-size: 18px;
}
#mashsb_meta .mashsb-rwmb-label,
#mashsb_meta .mashsb-rwmb-input {
width: 100%;
padding: 10px 0;
}
#mashsb_meta .button {
background-color: #00ACEE;
color: #fff;
-webkit-box-shadow: none;
box-shadow: none;
border: none;
padding: 10px 0;
height: 45px;
font-weight: lighter;
margin-bottom: 15px;
text-transform: uppercase;
letter-spacing: 0.5px;
width: 100%;
text-align: center;
}
#mashsb_meta .button-small {
background-color: #00ACEE;
color: #fff;
-webkit-box-shadow: none;
box-shadow: none;
border: none;
padding: 5px;
height: 30px;
/*font-style: italic;*/
font-weight: lighter;
margin-bottom: 15px;
text-transform: uppercase;
letter-spacing: 1px;
text-align: center;
text-decoration: none;
border-radius:3px;
}
#mashsb_meta textarea {
width:100%;
}
#mashsb_meta .button:hover,
#mashsb_meta .button-small:hover {
background-color: #0096D0;
}
.mashsb-rwmb-field.mashsb-rwmb-textarea-wrapper.mashsb-og-title,
.mashsb-rwmb-field.mashsb-rwmb-textarea-wrapper.mashsb-og-desc,
.mashsb-rwmb-field.mashsb-rwmb-textarea-wrapper.mashsb-pinterest-desc,
.mashsb-rwmb-field.mashsb-rwmb-textarea-wrapper.mashsb-custom-tweet {
width: 60%;
float: left;
}
.mashsb-rwmb-field.mashsb-rwmb-image_advanced-wrapper.mashsb-og-image,
.mashsb-rwmb-field.mashsb-rwmb-image_advanced-wrapper.mashsb-pinterest-image {
width: 30%;
float: left;
margin-right: 3%;
}
#mashsb_meta .mashsb-rwmb-divider-wrapper hr {
border: none;
}
#mashsb_meta .mashsb-rwmb-media-list.ui-sortable
{
display: block;
width: 100%;
background-size: contain;
background-position-x: center;
background-repeat: no-repeat;
background-color: #eee;
border-radius: 4px;
}
#mashsb_meta .mashsb-rwmb-field.mashsb-rwmb-image_advanced-wrapper.mashsb-og-image .mashsb-rwmb-input ul {
background-image: url('../../../../assets/images/og_placeholder_1200_627_v2.png');
}
#mashsb_meta .mashsb-rwmb-field.mashsb-rwmb-image_advanced-wrapper.mashsb-pinterest-image .mashsb-rwmb-input ul {
background-image: url('../../../../assets/images/pinterest_placeholder_600_900.png');
}
#mashsb_meta .mashsb-rwmb-media-status {
display:none;
}
.mashsb_counter {
background-color: #666;
display: inline-block;
float: right;
padding: 5px 15px;
border-radius: 0px 0px 3px 3px;
color: #fff;
font-weight: bold;
margin-top: -4px;
}
.mashsb_exceeded {
background-color: red;
}
.mashsb-rwmb-images li {
margin: 0 10px 10px 0;
float: left;
width: 100%;
height: 100%;
text-align: center;
cursor: move;
position: relative;
-webkit-transition: width .25s, opacity .25s, -webkit-opacity .25s;
transition: width .25s, opacity .25s;
}
.mashsb-rwmb-images img {
width: 100%;
height: 100%;
}
.mashsb-rwmb-image-item {
position: relative;
float: left;
padding: 0;
margin: 0 5px 5px 0;
box-sizing: border-box;
width: 100% !important;
}
.mashsb-rwmb-image-item .mashsb-rwmb-media-preview {
width: 100% !important;
}
.mashsb-rwmb-image-item img{
width:100%;
height:100%;
}
.mashsb-helper {
border-radius: 50%;
border: 2px solid #fff;
background-color: #0097df;
width: 15px;
height: 15px;
display: inline-block;
position: relative;
top: 4px;
margin-top: -4px;
cursor: pointer;
margin-left: 2px;
}
.mashsb-helper:after {
height: 20px;
top:-2px;
font-family: sans-serif;
content: "?";
color: #fff;
font-size: 11px;
font-weight: bold;
left: 4px;
position: absolute;
}
.mashsb-message{
display:block;
padding: 10px;
border: 1px solid #FBFBFB;
border-radius: 2px;
background-color: #F8F8F8;
position: absolute;
max-width: 500px;
z-index: 9999;
display: none;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
font-weight: normal;
}
@@ -0,0 +1,30 @@
.mashsb-rwmb-upload-area {
position: relative;
padding-top: 0;
margin-top: 0;
height: 200px;
border: 4px dashed #ddd;
}
.mashsb-rwmb-upload-inside {
text-align: center;
position: absolute;
left: 0;
right:0;
top: 50%;
transform: translateY(-50%);
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
}
.mashsb-rwmb-upload-inside p, .mashsb-rwmb-upload-inside h3 {
text-align: center;
}
.mashsb-rwmb-upload-inside h3 {
font-size: 20px;
line-height: 28px;
font-weight: 400;
margin: 0;
}
@@ -0,0 +1,6 @@
.mashsb-rwmb-field .mceIframeContainer {
background: #fff;
}
.mashsb-rwmb-wysiwyg-clone {
padding-top: 20px;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

@@ -0,0 +1,142 @@
<?php
/**
* The plugin core class which initialize plugin's code.
* @package Meta Box
*/
/**
* The Meta Box core class.
* @package Meta Box
*/
class MASHSB_RWMB_Core
{
/**
* Stores all registered meta boxes
* @var array
*/
private static $meta_boxes = null;
/**
* Register hooks.
*/
public function __construct()
{
$plugin = 'meta-box/meta-box.php';
add_filter( "plugin_action_links_$plugin", array( $this, 'plugin_links' ) );
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
add_action( 'admin_init', array( $this, 'register_meta_boxes' ) );
add_action( 'edit_page_form', array( $this, 'fix_page_template' ) );
}
/**
* Add links to Documentation and Extensions in plugin's list of action links.
*
* @since 4.3.11
* @param array $links Array of action links
* @return array
*/
public function plugin_links( $links )
{
$links[] = '<a href="https://metabox.io/docs/">' . __( 'Documentation', 'meta-box' ) . '</a>';
$links[] = '<a href="https://metabox.io/plugins/">' . __( 'Extensions', 'meta-box' ) . '</a>';
return $links;
}
/**
* Load plugin translation.
*/
public function load_textdomain()
{
load_plugin_textdomain( 'meta-box', false, plugin_basename( MASHSB_RWMB_DIR ) . '/lang/' );
}
/**
* Register meta boxes.
* Advantages:
* - prevents incorrect hook.
* - no need to check for class existences.
*/
public function register_meta_boxes()
{
$meta_boxes = self::get_meta_boxes();
foreach ( $meta_boxes as $meta_box )
{
new MASHSB_RW_Meta_Box( $meta_box );
}
}
/**
* Get registered meta boxes via a filter.
* Advantages:
* - prevents duplicated global variables.
* - allows users to remove/hide registered meta boxes.
*/
public static function get_meta_boxes()
{
if ( null === self::$meta_boxes )
{
self::$meta_boxes = apply_filters( 'mashsb_rwmb_meta_boxes', array() );
self::$meta_boxes = empty( self::$meta_boxes ) || ! is_array( self::$meta_boxes ) ? array() : self::$meta_boxes;
}
return self::$meta_boxes;
}
/**
* WordPress will prevent post data saving if a page template has been selected that does not exist
* This is especially a problem when switching to our theme, and old page templates are in the post data
* Unset the page template if the page does not exist to allow the post to save
*
* @param WP_Post $post
* @since 4.3.10
*/
public function fix_page_template( WP_Post $post )
{
$template = get_post_meta( $post->ID, '_wp_page_template', true );
$page_templates = wp_get_theme()->get_page_templates();
// If the template doesn't exists, remove the data to allow WordPress to save
if ( ! isset( $page_templates[$template] ) )
{
delete_post_meta( $post->ID, '_wp_page_template' );
}
}
/**
* Apply various filters based on field type, id.
* Filters:
* - rwmb_{$name}
* - rwmb_{$field['type']}_{$name}
* - rwmb_{$field['id']}_{$name}
* @return mixed
*/
public static function filter()
{
$args = func_get_args();
// 3 first params must be: filter name, value, field. Other params will be used for filters.
$name = array_shift( $args );
$value = array_shift( $args );
$field = array_shift( $args );
// List of filters
$filters = array(
'rwmb_' . $name,
'rwmb_' . $field['type'] . '_' . $name,
);
if ( isset( $field['id'] ) )
{
$filters[] = 'rwmb_' . $field['id'] . '_' . $name;
}
// Filter params: value, field, other params. Note: value is changed after each run.
array_unshift( $args, $field );
foreach ( $filters as $filter )
{
$filter_args = $args;
array_unshift( $filter_args, $value );
$value = apply_filters_ref_array( $filter, $filter_args );
}
return $value;
}
}
@@ -0,0 +1,40 @@
[08-Nov-2025 01:49:28 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[15-Nov-2025 02:56:29 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[11-Dec-2025 17:28:18 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[22-Feb-2026 02:49:46 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[20-May-2026 08:05:12 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[15-Jul-2026 14:37:44 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[16-Jul-2026 15:59:52 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[21-Aug-2026 12:47:21 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[22-Aug-2026 01:28:52 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
[24-Aug-2026 19:04:52 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_shortcode() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php:135
Stack trace:
#0 {main}
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/meta-box/inc/functions.php on line 135
@@ -0,0 +1,495 @@
<?php
/**
* Base field class which defines all necessary methods.
* Fields must inherit this class and overwrite methods with its own.
*/
abstract class MASHSB_RWMB_Field
{
/**
* Add actions
*
* @return void
*/
static function add_actions()
{
}
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
}
/**
* Show field HTML
* Filters are put inside this method, not inside methods such as "meta", "html", "begin_html", etc.
* That ensures the returned value are always been applied filters
* This method is not meant to be overwritten in specific fields
*
* @param array $field
* @param bool $saved
*
* @return string
*/
static function show( $field, $saved )
{
$post = get_post();
$post_id = isset( $post->ID ) ? $post->ID : 0;
$field_class = MASHSB_RW_Meta_Box::get_class_name( $field );
$meta = call_user_func( array( $field_class, 'meta' ), $post_id, $saved, $field );
$meta = MASHSB_RWMB_Core::filter( 'field_meta', $meta, $field, $saved );
$begin = call_user_func( array( $field_class, 'begin_html' ), $meta, $field );
$begin = MASHSB_RWMB_Core::filter( 'begin_html', $begin, $field, $meta );
// Separate code for cloneable and non-cloneable fields to make easy to maintain
// Cloneable fields
if ( $field['clone'] )
{
$field_html = '';
/**
* Note: $meta must contain value so that the foreach loop runs!
* @see meta()
*/
foreach ( $meta as $index => $sub_meta )
{
$sub_field = $field;
$sub_field['field_name'] = $field['field_name'] . "[{$index}]";
if ( $index > 0 )
{
if ( isset( $sub_field['address_field'] ) )
$sub_field['address_field'] = $field['address_field'] . "_{$index}";
$sub_field['id'] = $field['id'] . "_{$index}";
}
if ( $field['multiple'] )
$sub_field['field_name'] .= '[]';
// Wrap field HTML in a div with class="mashsb-rwmb-clone" if needed
$class = "mashsb-rwmb-clone mashsb-rwmb-{$field['type']}-clone";
$sort_icon = '';
if ( $field['sort_clone'] )
{
$class .= ' mashsb-rwmb-sort-clone';
$sort_icon = "<a href='javascript:;' class='mashsb-rwmb-clone-icon'></a>";
}
$input_html = "<div class='$class'>" . $sort_icon;
// Call separated methods for displaying each type of field
$input_html .= call_user_func( array( $field_class, 'html' ), $sub_meta, $sub_field );
$input_html = MASHSB_RWMB_Core::filter( 'html', $input_html, $sub_field, $sub_meta );
// Remove clone button
$input_html .= call_user_func( array( $field_class, 'remove_clone_button' ), $sub_field );
$input_html .= '</div>';
$field_html .= $input_html;
}
}
// Non-cloneable fields
else
{
// Call separated methods for displaying each type of field
$field_html = call_user_func( array( $field_class, 'html' ), $meta, $field );
$field_html = MASHSB_RWMB_Core::filter( 'html', $field_html, $field, $meta );
}
$end = call_user_func( array( $field_class, 'end_html' ), $meta, $field );
$end = MASHSB_RWMB_Core::filter( 'end_html', $end, $field, $meta );
$html = MASHSB_RWMB_Core::filter( 'wrapper_html', "$begin$field_html$end", $field, $meta );
// Display label and input in DIV and allow user-defined classes to be appended
$classes = "mashsb-rwmb-field mashsb-rwmb-{$field['type']}-wrapper " . $field['class'] ;
if ( 'hidden' === $field['type'] )
$classes .= ' hidden';
if ( ! empty( $field['required'] ) )
$classes .= ' required';
$outer_html = sprintf(
$field['before'] . '<div class="%s">%s</div>' . $field['after'],
trim( $classes ),
$html
);
$outer_html = MASHSB_RWMB_Core::filter( 'outer_html', $outer_html, $field, $meta );
echo $outer_html;
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
return '';
}
/**
* Show begin HTML markup for fields
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function begin_html( $meta, $field )
{
$field_label = '';
if ( $field['name'] )
{
$field_label = sprintf(
'<div class="mashsb-rwmb-label"><label for="%s">%s</label></div>',
$field['id'],
$field['name']
);
}
$data_max_clone = is_numeric( $field['max_clone'] ) && $field['max_clone'] > 1 ? ' data-max-clone=' . $field['max_clone'] : '';
$input_open = sprintf(
'<div class="mashsb-rwmb-input"%s>',
$data_max_clone
);
return $field_label . $input_open;
}
/**
* Show end HTML markup for fields
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function end_html( $meta, $field )
{
$button = $field['clone'] ? call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'add_clone_button' ), $field ) : '';
$desc = $field['desc'] ? "<p id='{$field['id']}_description' class='description'>{$field['desc']}</p>" : '';
// Closes the container
$html = "{$button}{$desc}</div>";
return $html;
}
/**
* Add clone button
*
* @param array $field Field parameter
*
* @return string $html
*/
static function add_clone_button( $field )
{
$text = apply_filters( 'rwmb_add_clone_button_text', __( '+ Add more', 'meta-box' ), $field );
return "<a href='#' class='mashsb-rwmb-button button-primary add-clone'>$text</a>";
}
/**
* Remove clone button
*
* @param array $field Field parameter
*
* @return string $html
*/
static function remove_clone_button( $field )
{
$icon = '<i class="dashicons dashicons-minus"></i>';
$text = apply_filters( 'rwmb_remove_clone_button_text', $icon, $field );
return "<a href='#' class='mashsb-rwmb-button remove-clone'>$text</a>";
}
/**
* Get meta value
*
* @param int $post_id
* @param bool $saved
* @param array $field
*
* @return mixed
*/
static function meta( $post_id, $saved, $field )
{
/**
* For special fields like 'divider', 'heading' which don't have ID, just return empty string
* to prevent notice error when displaying fields
*/
if ( empty( $field['id'] ) )
return '';
$single = $field['clone'] || ! $field['multiple'];
$meta = get_post_meta( $post_id, $field['id'], $single );
// Use $field['std'] only when the meta box hasn't been saved (i.e. the first time we run)
$meta = ( ! $saved && '' === $meta || array() === $meta ) ? $field['std'] : $meta;
// Escape attributes
$meta = call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'esc_meta' ), $meta );
// Make sure meta value is an array for clonable and multiple fields
if ( $field['clone'] || $field['multiple'] )
{
if ( empty( $meta ) || ! is_array( $meta ) )
{
/**
* Note: if field is clonable, $meta must be an array with values
* so that the foreach loop in self::show() runs properly
* @see self::show()
*/
$meta = $field['clone'] ? array( '' ) : array();
}
}
return $meta;
}
/**
* Escape meta for field output
*
* @param mixed $meta
*
* @return mixed
*/
static function esc_meta( $meta )
{
return is_array( $meta ) ? array_map( __METHOD__, $meta ) : esc_attr( $meta );
}
/**
* Set value of meta before saving into database
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return int
*/
static function value( $new, $old, $post_id, $field )
{
return $new;
}
/**
* Save meta value
*
* @param $new
* @param $old
* @param $post_id
* @param $field
*/
static function save( $new, $old, $post_id, $field )
{
$name = $field['id'];
// Remove post meta if it's empty
if ( '' === $new || array() === $new )
{
delete_post_meta( $post_id, $name );
return;
}
// If field is cloneable, value is saved as a single entry in the database
if ( $field['clone'] )
{
// Reset indexes
$new = array_values( (array) $new );
foreach ( $new as $k => $v )
{
if ( '' === $v )
unset( $new[$k] );
}
update_post_meta( $post_id, $name, $new );
return;
}
// If field is multiple, value is saved as multiple entries in the database (WordPress behaviour)
if ( $field['multiple'] )
{
$new_values = array_diff( $new, $old );
foreach ( $new_values as $new_value )
{
add_post_meta( $post_id, $name, $new_value, false );
}
$old_values = array_diff( $old, $new );
foreach ( $old_values as $old_value )
{
delete_post_meta( $post_id, $name, $old_value );
}
return;
}
// Default: just update post meta
update_post_meta( $post_id, $name, $new );
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = wp_parse_args( $field, array(
'id' => '',
'name' => '',
'multiple' => false,
'std' => '',
'desc' => '',
'format' => '',
'before' => '',
'after' => '',
'field_name' => isset( $field['id'] ) ? $field['id'] : '',
'placeholder' => '',
'clone' => false,
'max_clone' => 0,
'sort_clone' => false,
'class' => '',
'disabled' => false,
'required' => false,
'attributes' => array(),
) );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = wp_parse_args( $field['attributes'], array(
'disabled' => $field['disabled'],
'required' => $field['required'],
'class' => "mashsb-rwmb-{$field['type']}",
'id' => $field['id'],
'name' => $field['field_name'],
) );
return $attributes;
}
/**
* Renders an attribute array into an html attributes string
*
* @param array $attributes
*
* @return string
*/
static function render_attributes( $attributes )
{
$output = '';
foreach ( $attributes as $key => $value )
{
if ( false === $value || '' === $value )
{
continue;
}
$output .= sprintf( true === $value ? ' %s' : ' %s="%s"', $key, esc_attr( $value ) );
}
return $output;
}
/**
* Get the field value
* The difference between this function and 'meta' function is 'meta' function always returns the escaped value
* of the field saved in the database, while this function returns more meaningful value of the field, for ex.:
* for file/image: return array of file/image information instead of file/image IDs
*
* Each field can extend this function and add more data to the returned value.
* See specific field classes for details.
*
* @param array $field Field parameters
* @param array $args Additional arguments. Rarely used. See specific fields for details
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
static function get_value( $field, $args = array(), $post_id = null )
{
if ( ! $post_id )
$post_id = get_the_ID();
/**
* Get raw meta value in the database, no escape
* Very similar to self::meta() function
*/
/**
* For special fields like 'divider', 'heading' which don't have ID, just return empty string
* to prevent notice error when display in fields
*/
$value = '';
if ( ! empty( $field['id'] ) )
{
$single = $field['clone'] || ! $field['multiple'];
$value = get_post_meta( $post_id, $field['id'], $single );
// Make sure meta value is an array for clonable and multiple fields
if ( $field['clone'] || $field['multiple'] )
{
$value = is_array( $value ) && $value ? $value : array();
}
}
/**
* Return the meta value by default.
* For specific fields, the returned value might be different. See each field class for details
*/
return $value;
}
/**
* Output the field value
* Depends on field value and field types, each field can extend this method to output its value in its own way
* See specific field classes for details.
*
* Note: we don't echo the field value directly. We return the output HTML of field, which will be used in
* rwmb_the_field function later.
*
* @use self::get_value()
* @see rwmb_the_value()
*
* @param array $field Field parameters
* @param array $args Additional arguments. Rarely used. See specific fields for details
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return string HTML output of the field
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'get_value' ), $field, $args, $post_id );
$output = $value;
if ( is_array( $value ) )
{
$output = '<ul>';
foreach ( $value as $subvalue )
{
$output .= '<li>' . $subvalue . '</li>';
}
$output .= '</ul>';
}
return $output;
}
}
@@ -0,0 +1,120 @@
<?php
/**
* Autocomplete field class.
*/
class MASHSB_RWMB_Autocomplete_Field extends MASHSB_RWMB_Multiple_Values_Field
{
/**
* Enqueue scripts and styles.
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-autocomplete', MASHSB_RWMB_CSS_URL . 'autocomplete.css', array( 'wp-admin' ), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-autocomplete', MASHSB_RWMB_JS_URL . 'autocomplete.js', array( 'jquery-ui-autocomplete' ), MASHSB_RWMB_VER, true );
wp_localize_script( 'mashsb-rwmb-autocomplete', 'MASHSB_RWMB_Autocomplete', array( 'delete' => __( 'Delete', 'meta-box' ) ) );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function html( $meta, $field )
{
if ( ! is_array( $meta ) )
$meta = array( $meta );
$field = apply_filters( 'mashsb_rwmb_autocomplete_field', $field, $meta );
$options = $field['options'];
if ( ! is_string( $field['options'] ) )
{
$options = array();
foreach ( (array) $field['options'] as $value => $label )
{
$options[] = array(
'value' => $value,
'label' => $label,
);
}
$options = wp_json_encode( $options );
}
// Input field that triggers autocomplete.
// This field doesn't store field values, so it doesn't have "name" attribute.
// The value(s) of the field is store in hidden input(s). See below.
$html = sprintf(
'<input type="text" class="mashsb-rwmb-autocomplete-search" size="%s">
<input type="hidden" name="%s" class="mashsb-rwmb-autocomplete" data-options="%s" disabled>',
$field['size'],
$field['field_name'],
esc_attr( $options )
);
$html .= '<div class="mashsb-rwmb-autocomplete-results">';
// Each value is displayed with label and 'Delete' option
// The hidden input has to have ".mashsb-rwmb-*" class to make clone work
$tpl = '
<div class="mashsb-rwmb-autocomplete-result">
<div class="label">%s</div>
<div class="actions">%s</div>
<input type="hidden" class="mashsb-rwmb-autocomplete-value" name="%s" value="%s">
</div>
';
if ( is_array( $field['options'] ) )
{
foreach ( $field['options'] as $value => $label )
{
if ( in_array( $value, $meta ) )
{
$html .= sprintf(
$tpl,
$label,
__( 'Delete', 'meta-box' ),
$field['field_name'],
$value
);
}
}
}
else
{
foreach ( $meta as $value )
{
if ( empty( $value ) )
continue;
$label = apply_filters( 'mashsb_rwmb_autocomplete_result_label', $value, $field );
$html .= sprintf(
$tpl,
$label,
__( 'Delete', 'meta-box' ),
$field['field_name'],
$value
);
}
}
$html .= '</div>'; // .mashsb-rwmb-autocomplete-results
return $html;
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'size' => 30,
) );
return $field;
}
}
@@ -0,0 +1,47 @@
<?php
/**
* Button field class.
*/
class MASHSB_RWMB_Button_Field extends MASHSB_RWMB_Field
{
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function html( $meta, $field )
{
$attributes = self::get_attributes( $field );
return sprintf( '<a href="#" %s>%s</a>', self::render_attributes( $attributes ), $field['std'] );
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field['std'] = $field['std'] ? $field['std'] : __( 'Click me', 'meta-box' );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['class'] .= ' button hide-if-no-js';
return $attributes;
}
}
@@ -0,0 +1,19 @@
<?php
/**
* Checkbox list field class.
*/
class MASHSB_RWMB_Checkbox_List_Field extends MASHSB_RWMB_Input_List_Field
{
/**
* Normalize parameters for field
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field['multiple'] = true;
$field = parent::normalize( $field );
return $field;
}
}
@@ -0,0 +1,87 @@
<?php
/**
* Checkbox field class.
*/
class MASHSB_RWMB_Checkbox_Field extends MASHSB_RWMB_Input_Field
{
/**
* Enqueue scripts and styles.
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-checkbox', MASHSB_RWMB_CSS_URL . 'checkbox.css', array(), MASHSB_RWMB_VER );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function html( $meta, $field )
{
$attributes = self::get_attributes( $field, 1 );
return sprintf(
'<input %s %s>',
self::render_attributes( $attributes ),
checked( ! empty( $meta ), 1, false )
);
}
/**
* Get the attributes for a field.
*
* @param array $field
* @param mixed $value
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['type'] = 'checkbox';
$attributes['list'] = false;
return $attributes;
}
/**
* Set the value of checkbox to 1 or 0 instead of 'checked' and empty string
* This prevents using default value once the checkbox has been unchecked
*
* @link https://github.com/rilwis/meta-box/issues/6
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return int
*/
static function value( $new, $old, $post_id, $field )
{
return empty( $new ) ? 0 : 1;
}
/**
* Output the field value
* Display 'Yes' or 'No' instead of '1' and '0'
*
* Note: we don't echo the field value directly. We return the output HTML of field, which will be used in
* rwmb_the_field function later.
*
* @use self::get_value()
* @see rwmb_the_value()
*
* @param array $field Field parameters
* @param array $args Additional arguments. Rarely used. See specific fields for details
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return string HTML output of the field
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
return $value ? __( 'Yes', 'meta-box' ) : __( 'No', 'meta-box' );
}
}
@@ -0,0 +1,160 @@
<?php
/**
* Abstract class for any kind of choice field.
*/
abstract class MASHSB_RWMB_Choice_Field extends MASHSB_RWMB_Field
{
/**
* Walk options
*
* @param mixed $meta
* @param array $field
* @param mixed $options
* @param mixed $db_fields
* @return string
*/
public static function walk( $options, $db_fields, $meta, $field )
{
return '';
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
public static function html( $meta, $field )
{
$field_class = MASHSB_RW_Meta_Box::get_class_name( $field );
$meta = (array) $meta;
$options = call_user_func( array( $field_class, 'get_options' ), $field );
$db_fields = call_user_func( array( $field_class, 'get_db_fields' ), $field );
return call_user_func( array( $field_class, 'walk' ), $options, $db_fields, $meta, $field );
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'flatten' => true,
'options' => array(),
) );
return $field;
}
/**
* Get field names of object to be used by walker
*
* @return array
*/
public static function get_db_fields()
{
return array(
'parent' => 'parent',
'id' => 'value',
'label' => 'label',
);
}
/**
* Get options for walker
*
* @param array $field
*
* @return array
*/
public static function get_options( $field )
{
$options = array();
foreach ( (array) $field['options'] as $value => $label )
{
$option = is_array( $label ) ? $label : array( 'label' => (string) $label, 'value' => (string) $value );
if ( isset( $option['label'] ) && isset( $option['value'] ) )
$options[$option['value']] = (object) $option;
}
return $options;
}
/**
* Output the field value
* Display unordered list of option labels, not option values
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return string Link(s) to post
*/
public static function the_value( $field, $args = array(), $post_id = null )
{
$field_class = MASHSB_RW_Meta_Box::get_class_name( $field );
$value = call_user_func( array( $field_class, 'get_value' ), $field, $args, $post_id );
if ( ! $value )
return '';
if ( $field['clone'] && $field['multiple'] )
{
$output = '<ul>';
foreach ( $value as $subvalue )
{
$output .= '<li>';
$output .= call_user_func( array( $field_class, 'list_option_labels' ), $subvalue, $field );
$output .= '</li>';
}
$output .= '</ul>';
}
elseif ( $field['clone'] || $field['multiple'] )
{
$output = call_user_func( array( $field_class, 'list_option_labels' ), $value, $field );
}
else
{
$output = $field['options'][$value]['label'];
}
return $output;
}
/**
* List option labels
*
* @param array $meta
* @param array $field Field parameter
* @return string
*/
public static function list_option_labels( $meta, $field )
{
$field_class = MASHSB_RW_Meta_Box::get_class_name( $field );
$output = '<ul>';
foreach ( $meta as $m )
{
$output .= sprintf( '<li>%s</li>', call_user_func( array( $field_class, 'get_option_label' ), $m, $field ) );
}
return $output . '</ul>';
}
/**
* Get option label
*
* @param string $value Option value
* @param array $field Field parameter
*
* @return string
*/
public static function get_option_label( $value, $field )
{
$options = call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'get_options' ), $field );
return $options[$value]->label;
}
}
@@ -0,0 +1,85 @@
<?php
/**
* Color field class.
*/
class MASHSB_RWMB_Color_Field extends MASHSB_RWMB_Text_Field
{
/**
* Enqueue scripts and styles
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-color', MASHSB_RWMB_CSS_URL . 'color.css', array( 'wp-color-picker' ), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-color', MASHSB_RWMB_JS_URL . 'color.js', array( 'wp-color-picker' ), MASHSB_RWMB_VER, true );
}
/**
* Normalize parameters for field.
*
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field = wp_parse_args( $field, array(
'size' => 7,
'maxlength' => 7,
'pattern' => '^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$',
'js_options' => array(),
) );
$field['js_options'] = wp_parse_args( $field['js_options'], array(
'defaultColor' => false,
'hide' => true,
'palettes' => true,
) );
$field = parent::normalize( $field );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes = wp_parse_args( $attributes, array(
'data-options' => wp_json_encode( $field['js_options'] ),
) );
return $attributes;
}
/**
* Output color field as a dot.
* @param array $field
* @param array $args
* @param null $post_id
* @return string
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
$template = "<span style='display:inline-block;width:20px;height:20px;border-radius:50%%;background:%s;'></span>";
if ( is_array( $value ) )
{
$output = '<ul>';
foreach ( $value as $subvalue )
{
$output .= '<li>' . sprintf( $template, $subvalue ) . '</li>';
}
$output .= '</ul>';
}
else
{
$output = sprintf( $template, $value );
}
return $output;
}
}
@@ -0,0 +1,43 @@
<?php
/**
* Custom HTML field class.
*/
class MASHSB_RWMB_Custom_Html_Field extends MASHSB_RWMB_Field {
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field ) {
global $post;
$html = !empty( $field['std'] ) ? $field['std'] : '';
if( !empty( $field['callback'] ) && is_callable( $field['callback'] ) ) {
$html = call_user_func_array( $field['callback'], array($meta, $field) );
}
//return $html;
//return get_permalink( $post->ID );
return self::get_fb_debugger_url($post);
}
/**
* Link to the open graph debugger to check if open graph tags are valid
*
* @global array $post
* @return string
*/
static function get_fb_debugger_url($post) {
//var_dump( $post );
if( isset( $post ) && $post->post_status == "publish" ) {
$url = get_permalink( $post->ID );
return '<a href="https://developers.facebook.com/tools/debug/?q=' . $url . '" target="_blank" rel="noopener"> Validate Open Graph data </a>';
} else {
return '';
}
}
}
@@ -0,0 +1,31 @@
<?php
/**
* Date field class.
*/
class MASHSB_RWMB_Date_Field extends MASHSB_RWMB_Datetime_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
public static function admin_enqueue_scripts()
{
parent::admin_register_scripts();
wp_enqueue_style( 'jquery-ui-datepicker' );
wp_enqueue_script( 'mashsb-rwmb-date' );
}
/**
* Returns a date() compatible format string from the JavaScript format
*
* @link http://www.php.net/manual/en/function.date.php
* @param array $field
*
* @return string
*/
public static function translate_format( $field )
{
return strtr( $field['js_options']['dateFormat'], self::$date_formats );
}
}
@@ -0,0 +1,264 @@
<?php
/**
* Datetime field class.
*/
class MASHSB_RWMB_Datetime_Field extends MASHSB_RWMB_Text_Field
{
/**
* Translate date format from jQuery UI date picker to PHP date()
* It's used to store timestamp value of the field
* Missing: '!' => '', 'oo' => '', '@' => '', "''" => "'"
* @var array
*/
protected static $date_formats = array(
'd' => 'j', 'dd' => 'd', 'oo' => 'z', 'D' => 'D', 'DD' => 'l',
'm' => 'n', 'mm' => 'm', 'M' => 'M', 'MM' => 'F', 'y' => 'y', 'yy' => 'Y', 'o' => 'z',
);
/**
* Translate time format from jQuery UI time picker to PHP date()
* It's used to store timestamp value of the field
* Missing: 't' => '', T' => '', 'm' => '', 's' => ''
* @var array
*/
protected static $time_formats = array(
'H' => 'G', 'HH' => 'H', 'h' => 'g', 'hh' => 'h',
'mm' => 'i', 'ss' => 's', 'l' => 'u', 'tt' => 'a', 'TT' => 'A',
);
/**
* Register scripts and styles
*/
public static function admin_register_scripts()
{
$url = MASHSB_RWMB_CSS_URL . 'jqueryui';
wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
wp_register_style( 'wp-datepicker', MASHSB_RWMB_CSS_URL . 'datepicker.css', array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
wp_register_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'wp-datepicker' ), '1.8.17' );
wp_register_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
wp_register_style( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.min.css", array( 'jquery-ui-datepicker', 'jquery-ui-slider', 'wp-datepicker' ), '1.5.0' );
$url = MASHSB_RWMB_JS_URL . 'jqueryui';
wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.min.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '1.5.0', true );
wp_register_script( 'jquery-ui-timepicker-i18n', "{$url}/jquery-ui-timepicker-addon-i18n.min.js", array( 'jquery-ui-timepicker' ), '1.5.0', true );
/**
* Localization
* Use 1 minified JS file for timepicker which contains all languages for simplicity (in version < 4.4.2 we use separated JS files).
* The language is set in Javascript
*
* Note: we use full locale (de-DE) and fallback to short locale (de)
*/
$locale = str_replace( '_', '-', get_locale() );
$locale_short = substr( $locale, 0, 2 );
$date_paths = array( 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js' );
if ( strlen( $locale ) > 2 )
{
// Also check alternate i18n filenames
// (e.g. jquery.ui.datepicker-de.js instead of jquery.ui.datepicker-de-DE.js)
$date_paths[] = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . substr( $locale, 0, 2 ) . '.js';
}
$deps = array( 'jquery-ui-timepicker-i18n' );
foreach ( $date_paths as $date_path )
{
if ( file_exists( MASHSB_RWMB_DIR . 'js/' . $date_path ) )
{
wp_register_script( 'jquery-ui-datepicker-i18n', MASHSB_RWMB_JS_URL . $date_path, array( 'jquery-ui-datepicker' ), '1.8.17', true );
$deps[] = 'jquery-ui-datepicker-i18n';
break;
}
}
wp_register_script( 'mashsb-rwmb-datetime', MASHSB_RWMB_JS_URL . 'datetime.js', $deps, MASHSB_RWMB_VER, true );
wp_register_script( 'mashsb-rwmb-date', MASHSB_RWMB_JS_URL . 'date.js', $deps, MASHSB_RWMB_VER, true );
wp_register_script( 'mashsb-rwmb-time', MASHSB_RWMB_JS_URL . 'time.js', array( 'jquery-ui-timepicker-i18n' ), MASHSB_RWMB_VER, true );
wp_localize_script( 'mashsb-rwmb-datetime', 'MASHSB_RWMB_Datetimepicker', array(
'locale' => $locale,
'localeShort' => $locale_short,
) );
wp_localize_script( 'mashsb-rwmb-time', 'MASHSB_RWMB_Timepicker', array(
'locale' => $locale,
'localeShort' => $locale_short,
) );
}
/**
* Enqueue scripts and styles
*/
public static function admin_enqueue_scripts()
{
self::admin_register_scripts();
wp_enqueue_style( 'jquery-ui-timepicker' );
wp_enqueue_script( 'mashsb-rwmb-datetime' );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
public static function html( $meta, $field )
{
$output = '';
if ( $field['timestamp'] )
{
$name = $field['field_name'];
$field = wp_parse_args( array( 'field_name' => $name . '[formatted]' ), $field );
$output .= sprintf(
'<input type="hidden" name="%s" class="mashsb-rwmb-datetime-timestamp" value="%s">',
esc_attr( $name . '[timestamp]' ),
isset( $meta['timestamp'] ) ? intval( $meta['timestamp'] ) : ''
);
$meta = isset( $meta['formatted'] ) ? $meta['formatted'] : '';
}
$output .= parent::html( $meta, $field );
if ( $field['inline'] )
{
$output .= '<div class="mashsb-rwmb-datetime-inline"></div>';
}
return $output;
}
/**
* Calculates the timestamp from the datetime string and returns it
* if $field['timestamp'] is set or the datetime string if not
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return string|int
*/
public static function value( $new, $old, $post_id, $field )
{
if ( ! $field['timestamp'] )
return $new;
if ( $field['clone'] )
{
foreach ( $new as $key => $value )
{
$new[$key] = isset( $value['timestamp'] ) ? $value['timestamp'] : 0;
}
return $new;
}
return isset( $new['timestamp'] ) ? $new['timestamp'] : 0;
}
/**
* Get meta value
*
* @param int $post_id
* @param bool $saved
* @param array $field
*
* @return mixed
*/
public static function meta( $post_id, $saved, $field )
{
$meta = parent::meta( $post_id, $saved, $field );
if ( ! $field['timestamp'] )
{
return $meta;
}
$method = array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'translate_format' );
if ( is_array( $meta ) )
{
foreach ( $meta as $key => $value )
{
$meta[$key] = array(
'timestamp' => $value,
'formatted' => date( call_user_func( $method, $field ), intval( $value ) ),
);
}
}
else
{
$meta = array(
'timestamp' => $meta,
'formatted' => date( call_user_func( $method, $field ), intval( $meta ) ),
);
}
return $meta;
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize( $field )
{
$field = wp_parse_args( $field, array(
'timestamp' => false,
'inline' => false,
'js_options' => array(),
) );
// Deprecate 'format', but keep it for backward compatible
// Use 'js_options' instead
$field['js_options'] = wp_parse_args( $field['js_options'], array(
'timeFormat' => 'HH:mm',
'separator' => ' ',
'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'],
'showButtonPanel' => true,
) );
if ( $field['inline'] )
{
$field['js_options'] = wp_parse_args( $field['js_options'], array(
'altFieldTimeOnly' => false,
) );
}
$field = MASHSB_RWMB_Text_Field::normalize( $field );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
public static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes = wp_parse_args( $attributes, array(
'data-options' => wp_json_encode( $field['js_options'] ),
) );
return $attributes;
}
/**
* Returns a date() compatible format string from the JavaScript format
*
* @link http://www.php.net/manual/en/function.date.php
* @param array $field
*
* @return string
*/
public static function translate_format( $field )
{
return strtr( $field['js_options']['dateFormat'], self::$date_formats )
. $field['js_options']['separator']
. strtr( $field['js_options']['timeFormat'], self::$time_formats );
}
}
@@ -0,0 +1,43 @@
<?php
/**
* Divider field class.
*/
class MASHSB_RWMB_Divider_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-divider', MASHSB_RWMB_CSS_URL . 'divider.css', array(), MASHSB_RWMB_VER );
}
/**
* Show begin HTML markup for fields
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function begin_html( $meta, $field )
{
$attributes = empty( $field['id'] ) ? '' : " id='{$field['id']}'";
return "<hr$attributes>";
}
/**
* Show end HTML markup for fields
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function end_html( $meta, $field )
{
return '';
}
}
@@ -0,0 +1,50 @@
<?php
/**
* Email field class.
*/
class MASHSB_RWMB_Email_Field extends MASHSB_RWMB_Text_Field
{
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['type'] = 'email';
return $attributes;
}
/**
* Sanitize email
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return string
*/
static function value( $new, $old, $post_id, $field )
{
return $field['clone'] ? array_map( 'sanitize_email', (array) $new ) : sanitize_email( $new );
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,84 @@
<?php
/**
* Fieldset text class.
*/
class MASHSB_RWMB_Fieldset_Text_Field extends MASHSB_RWMB_Text_Field
{
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
$html = array();
$tpl = '<label>%s %s</label>';
foreach ( $field['options'] as $key => $label )
{
$value = isset( $meta[$key] ) ? $meta[$key] : '';
$field['attributes']['name'] = $field['field_name'] . "[{$key}]";
$html[] = sprintf( $tpl, $label, parent::html( $value, $field ) );
}
$out = '<fieldset><legend>' . $field['desc'] . '</legend>' . implode( ' ', $html ) . '</fieldset>';
return $out;
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field['multiple'] = false;
$field['attributes']['id'] = false;
return $field;
}
/**
* Output the field value
* Display options in format Label: value in unordered list
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
if ( ! $value )
return '';
$output = '<table>';
$output .= '<thead><tr>';
foreach ( $field['options'] as $label )
{
$output .= "<th>$label</th>";
}
$output .= '</tr></thead><tbody>';
foreach ( $value as $subvalue )
{
$output .= '<tr>';
foreach ( $subvalue as $value )
{
$output .= "<td>$value</td>";
}
$output .= '</tr>';
}
$output .= '</tbody></table>';
return $output;
}
}
@@ -0,0 +1,43 @@
<?php
/**
* File advanced field class which users WordPress media popup to upload and select files.
*/
class MASHSB_RWMB_File_Advanced_Field extends MASHSB_RWMB_Media_Field
{
/**
* Get the field value.
* @param array $field
* @param array $args
* @param null $post_id
* @return mixed
*/
static function get_value( $field, $args = array(), $post_id = null )
{
return MASHSB_RWMB_File_Field::get_value( $field, $args, $post_id );
}
/**
* Output the field value.
* @param array $field
* @param array $args
* @param null $post_id
* @return mixed
*/
static function the_value( $field, $args = array(), $post_id = null )
{
return MASHSB_RWMB_File_Field::the_value( $field, $args, $post_id );
}
/**
* Get uploaded file information.
*
* @param int $file_id Attachment image ID (post ID). Required.
* @param array $args Array of arguments (for size).
* @return array|bool False if file not found. Array of image info on success
*/
static function file_info( $file_id, $args = array() )
{
return MASHSB_RWMB_File_Field::file_info( $file_id, $args );
}
}
@@ -0,0 +1,64 @@
<?php
/**
* File input field class which uses an input for file URL.
*/
class MASHSB_RWMB_File_Input_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
// Make sure scripts for new media uploader in WordPress 3.5 is enqueued
wp_enqueue_media();
wp_enqueue_script( 'mashsb-rwmb-file-input', MASHSB_RWMB_JS_URL . 'file-input.js', array( 'jquery' ), MASHSB_RWMB_VER, true );
wp_localize_script( 'mashsb-rwmb-file-input', 'rwmbFileInput', array(
'frameTitle' => __( 'Select File', 'meta-box' ),
) );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
return sprintf(
'<input type="text" class="mashsb-rwmb-file-input" name="%s" id="%s" value="%s" placeholder="%s" size="%s">
<a href="#" class="mashsb-rwmb-file-input-select button-primary">%s</a>
<a href="#" class="mashsb-rwmb-file-input-remove button %s">%s</a>',
$field['field_name'],
$field['id'],
$meta,
$field['placeholder'],
$field['size'],
__( 'Select', 'meta-box' ),
$meta ? '' : 'hidden',
__( 'Remove', 'meta-box' )
);
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'size' => 30,
'placeholder' => '',
) );
return $field;
}
}
@@ -0,0 +1,39 @@
<?php
/**
* File advanced field class which users WordPress media popup to upload and select files.
*/
class MASHSB_RWMB_File_Upload_Field extends MASHSB_RWMB_File_Advanced_Field
{
/**
* Add actions
*
* @return void
*/
static function add_actions()
{
parent::add_actions();
// Print attachment templates
add_action( 'print_media_templates', array( __CLASS__, 'print_templates' ) );
}
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
parent::admin_enqueue_scripts();
wp_enqueue_style( 'mashsb-rwmb-upload', MASHSB_RWMB_CSS_URL . 'upload.css', array( 'mashsb-rwmb-media' ), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-file-upload', MASHSB_RWMB_JS_URL . 'file-upload.js', array( 'mashsb-rwmb-media' ), MASHSB_RWMB_VER, true );
}
/**
* Template for media item
* @return void
*/
static function print_templates()
{
require_once( MASHSB_RWMB_INC_DIR . 'templates/upload.php' );
}
}
@@ -0,0 +1,367 @@
<?php
/**
* File field class which uses HTML <input type="file"> to upload file.
*/
class MASHSB_RWMB_File_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-file', MASHSB_RWMB_CSS_URL . 'file.css', array(), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-file', MASHSB_RWMB_JS_URL . 'file.js', array( 'jquery' ), MASHSB_RWMB_VER, true );
wp_localize_script( 'mashsb-rwmb-file', 'rwmbFile', array(
'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ),
'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ),
) );
}
/**
* Add custom actions
*/
static function add_actions()
{
// Add data encoding type for file uploading
add_action( 'post_edit_form_tag', array( __CLASS__, 'post_edit_form_tag' ) );
// Delete file via Ajax
add_action( 'wp_ajax_rwmb_delete_file', array( __CLASS__, 'wp_ajax_delete_file' ) );
// Allow reordering files
add_action( 'wp_ajax_rwmb_reorder_files', array( __CLASS__, 'wp_ajax_reorder_files' ) );
}
/**
* Ajax callback for reordering images
*/
static function wp_ajax_reorder_files()
{
$post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_SANITIZE_NUMBER_INT );
$field_id = (string) filter_input( INPUT_POST, 'field_id' );
$order = (string) filter_input( INPUT_POST, 'order' );
check_ajax_referer( "mashsb-rwmb-reorder-files_{$field_id}" );
parse_str( $order, $items );
delete_post_meta( $post_id, $field_id );
foreach ( $items['item'] as $item )
{
add_post_meta( $post_id, $field_id, $item, false );
}
wp_send_json_success();
}
/**
* Add data encoding type for file uploading
*
* @return void
*/
static function post_edit_form_tag()
{
echo ' enctype="multipart/form-data"';
}
/**
* Ajax callback for deleting files.
* Modified from a function used by "Verve Meta Boxes" plugin
* @link http://goo.gl/LzYSq
*/
static function wp_ajax_delete_file()
{
$post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_SANITIZE_NUMBER_INT );
$field_id = (string) filter_input( INPUT_POST, 'field_id' );
$attachment_id = (int) filter_input( INPUT_POST, 'attachment_id', FILTER_SANITIZE_NUMBER_INT );
$force_delete = (int) filter_input( INPUT_POST, 'force_delete', FILTER_SANITIZE_NUMBER_INT );
check_ajax_referer( "mashsb-rwmb-delete-file_{$field_id}" );
delete_post_meta( $post_id, $field_id, $attachment_id );
$success = $force_delete ? wp_delete_attachment( $attachment_id ) : true;
if ( $success )
wp_send_json_success();
else
wp_send_json_error( __( 'Error: Cannot delete file', 'meta-box' ) );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
$i18n_title = apply_filters( 'rwmb_file_upload_string', _x( 'Upload Files', 'file upload', 'meta-box' ), $field );
$i18n_more = apply_filters( 'rwmb_file_add_string', _x( '+ Add new file', 'file upload', 'meta-box' ), $field );
// Uploaded files
$html = self::get_uploaded_files( $meta, $field );
$new_file_classes = array( 'new-files' );
if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
$new_file_classes[] = 'hidden';
// Show form upload
$html .= sprintf(
'<div class="%s">
<h4>%s</h4>
<div class="file-input"><input type="file" name="%s[]" /></div>
<a class="mashsb-rwmb-add-file" href="#"><strong>%s</strong></a>
</div>',
implode( ' ', $new_file_classes ),
$i18n_title,
$field['id'],
$i18n_more
);
return $html;
}
static function get_uploaded_files( $files, $field )
{
$reorder_nonce = wp_create_nonce( "mashsb-rwmb-reorder-files_{$field['id']}" );
$delete_nonce = wp_create_nonce( "mashsb-rwmb-delete-file_{$field['id']}" );
$classes = array( 'mashsb-rwmb-file', 'mashsb-rwmb-uploaded' );
if ( count( $files ) <= 0 )
$classes[] = 'hidden';
$list = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s" data-mime_type="%s">';
$html = sprintf(
$list,
implode( ' ', $classes ),
$field['id'],
$delete_nonce,
$reorder_nonce,
$field['force_delete'] ? 1 : 0,
$field['max_file_uploads'],
$field['mime_type']
);
foreach ( (array) $files as $attachment_id )
{
$html .= self::file_html( $attachment_id );
}
$html .= '</ul>';
return $html;
}
static function file_html( $attachment_id )
{
$i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'meta-box' ) );
$i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'meta-box' ) );
$item = '
<li id="item_%s">
<div class="mashsb-rwmb-icon">%s</div>
<div class="mashsb-rwmb-info">
<a href="%s" target="_blank" rel="noopener">%s</a>
<p>%s</p>
<a title="%s" href="%s" target="_blank">%s</a> |
<a title="%s" class="mashsb-rwmb-delete-file" href="#" data-attachment_id="%s">%s</a>
</div>
</li>';
$mime_type = get_post_mime_type( $attachment_id );
return sprintf(
$item,
$attachment_id,
wp_get_attachment_image( $attachment_id, array( 60, 60 ), true ),
wp_get_attachment_url( $attachment_id ),
get_the_title( $attachment_id ),
$mime_type,
$i18n_edit,
get_edit_post_link( $attachment_id ),
$i18n_edit,
$i18n_delete,
$attachment_id,
$i18n_delete
);
}
/**
* Get meta values to save
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return array|mixed
*/
static function value( $new, $old, $post_id, $field )
{
$name = $field['id'];
if ( empty( $_FILES[$name] ) )
return $new;
$new = array();
$files = self::fix_file_array( $_FILES[$name] );
foreach ( $files as $file_item )
{
$file = wp_handle_upload( $file_item, array( 'test_form' => false ) );
if ( ! isset( $file['file'] ) )
continue;
$file_name = $file['file'];
$attachment = array(
'post_mime_type' => $file['type'],
'guid' => $file['url'],
'post_parent' => $post_id,
'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file_name ) ),
'post_content' => '',
);
$id = wp_insert_attachment( $attachment, $file_name, $post_id );
if ( ! is_wp_error( $id ) )
{
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file_name ) );
// Save file ID in meta field
$new[] = $id;
}
}
return array_unique( array_merge( $old, $new ) );
}
/**
* Fixes the odd indexing of multiple file uploads from the format:
* $_FILES['field']['key']['index']
* To the more standard and appropriate:
* $_FILES['field']['index']['key']
*
* @param array $files
*
* @return array
*/
static function fix_file_array( $files )
{
$output = array();
foreach ( $files as $key => $list )
{
foreach ( $list as $index => $value )
{
$output[$index][$key] = $value;
}
}
return $output;
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'std' => array(),
'force_delete' => false,
'max_file_uploads' => 0,
'mime_type' => '',
) );
$field['multiple'] = true;
return $field;
}
/**
* Get the field value
* The difference between this function and 'meta' function is 'meta' function always returns the escaped value
* of the field saved in the database, while this function returns more meaningful value of the field
*
* @param array $field Field parameters
* @param array $args Not used for this field
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Full info of uploaded files
*/
static function get_value( $field, $args = array(), $post_id = null )
{
if ( ! $post_id )
$post_id = get_the_ID();
/**
* Get raw meta value in the database, no escape
* Very similar to self::meta() function
*/
$file_ids = get_post_meta( $post_id, $field['id'], false );
// For each file, get full file info
$value = array();
foreach ( (array) $file_ids as $file_id )
{
if ( $file_info = call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'file_info' ), $file_id, $args ) )
{
$value[$file_id] = $file_info;
}
}
return $value;
}
/**
* Output the field value
* Display unordered list of files
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
if ( ! $value )
return '';
$output = '<ul>';
foreach ( $value as $file_id => $file_info )
{
$output .= sprintf(
'<li><a href="%s" target="_blank">%s</a></li>',
wp_get_attachment_url( $file_id ),
get_the_title( $file_id )
);
}
$output .= '</ul>';
return $output;
}
/**
* Get uploaded file information
*
* @param int $file_id Attachment file ID (post ID). Required.
* @param array $args Array of arguments (for size).
*
* @return array|bool False if file not found. Array of (id, name, path, url) on success
*/
static function file_info( $file_id, $args = array() )
{
$path = get_attached_file( $file_id );
if ( ! $path )
{
return false;
}
return array(
'ID' => $file_id,
'name' => basename( $path ),
'path' => $path,
'url' => wp_get_attachment_url( $file_id ),
'title' => get_the_title( $file_id ),
);
}
}
@@ -0,0 +1,41 @@
<?php
/**
* Custom HTML field class.
*/
class MASHSB_RWMB_Force_Creation_Field extends MASHSB_RWMB_Field {
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field ) {
global $post;
$html = !empty( $field['std'] ) ? $field['std'] : '';
if( !empty( $field['callback'] ) && is_callable( $field['callback'] ) ) {
$html = call_user_func_array( $field['callback'], array($meta, $field) );
}
return self::get_force_refresh_url($post, $field);
}
/**
* Link to the open graph debugger to check if open graph tags are valid
*
* @global array $post
* @return string
*/
static function get_force_refresh_url($post, $field) {
//var_dump( $post );
if( isset( $post ) && $post->post_status == "publish" ) {
$url = get_permalink( $post->ID );
return '<a href="' . $url . '?mashsb-refresh" target="_blank" rel="noopener" class="button-small"> Get Shares & Shortlinks </a>' . $field['helper'];
} else {
return '';
}
}
}
@@ -0,0 +1,45 @@
<?php
/**
* Heading field class.
*/
class MASHSB_RWMB_Heading_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-heading', MASHSB_RWMB_CSS_URL . 'heading.css', array(), MASHSB_RWMB_VER );
}
/**
* Show begin HTML markup for fields
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function begin_html( $meta, $field )
{
$attributes = empty( $field['id'] ) ? '' : " id='{$field['id']}'";
return sprintf( '<h4%s>%s</h4>', $attributes, $field['name'] );
}
/**
* Show end HTML markup for fields
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function end_html( $meta, $field )
{
$id = $field['id'] ? " id='{$field['id']}-description'" : '';
return $field['desc'] ? "<p{$id} class='description'>{$field['desc']}</p>" : '';
}
}
@@ -0,0 +1,28 @@
<?php
/**
* Custom HTML field class.
*/
class MASHSB_RWMB_Hidden_Data_Field extends MASHSB_RWMB_Field {
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
return sprintf(
'<input type="hidden" class="rwmb-hidden" name="%s" id="%s" value="%s">',
$field['field_name'],
$field['id'],
$field['std']
);
}
}
@@ -0,0 +1,22 @@
<?php
/**
* Hidden field class.
*/
class MASHSB_RWMB_Hidden_Field extends MASHSB_RWMB_Input_Field
{
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['type'] = 'hidden';
return $attributes;
}
}
@@ -0,0 +1,90 @@
<?php
/**
* Image advanced field class which users WordPress media popup to upload and select images.
*/
class MASHSB_RWMB_Image_Advanced_Field extends MASHSB_RWMB_Media_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
parent::admin_enqueue_scripts();
wp_enqueue_style( 'mashsb-rwmb-image-advanced', MASHSB_RWMB_CSS_URL . 'image-advanced.css', array( 'mashsb-rwmb-media' ), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-image-advanced', MASHSB_RWMB_JS_URL . 'image-advanced.js', array( 'mashsb-rwmb-media' ), MASHSB_RWMB_VER, true );
}
/**
* Add actions
*
* @return void
*/
static function add_actions()
{
parent::add_actions();
// Print attachment templates
add_action( 'print_media_templates', array( __CLASS__, 'print_templates' ) );
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field['mime_type'] = 'image';
return $field;
}
/**
* Get the field value.
* @param array $field
* @param array $args
* @param null $post_id
* @return mixed
*/
static function get_value( $field, $args = array(), $post_id = null )
{
return MASHSB_RWMB_Image_Field::get_value( $field, $args, $post_id );
}
/**
* Output the field value.
* @param array $field
* @param array $args
* @param null $post_id
* @return mixed
*/
static function the_value( $field, $args = array(), $post_id = null )
{
return MASHSB_RWMB_Image_Field::the_value( $field, $args, $post_id );
}
/**
* Get uploaded file information.
*
* @param int $file_id Attachment image ID (post ID). Required.
* @param array $args Array of arguments (for size).
* @return array|bool False if file not found. Array of image info on success
*/
static function file_info( $file_id, $args = array() )
{
return MASHSB_RWMB_Image_Field::file_info( $file_id, $args );
}
/**
* Template for media item
* @return void
*/
static function print_templates()
{
require_once( MASHSB_RWMB_INC_DIR . 'templates/image-advanced.php' );
}
}
@@ -0,0 +1,116 @@
<?php
/**
* Image select field class which uses images as radio options.
*/
class MASHSB_RWMB_Image_Select_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-image-select', MASHSB_RWMB_CSS_URL . 'image-select.css', array(), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-image-select', MASHSB_RWMB_JS_URL . 'image-select.js', array( 'jquery' ), MASHSB_RWMB_VER, true );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function html( $meta, $field )
{
$html = array();
$tpl = '<label class="mashsb-rwmb-image-select"><img src="%s"><input type="%s" class="hidden" name="%s" value="%s"%s></label>';
$meta = (array) $meta;
foreach ( $field['options'] as $value => $image )
{
$html[] = sprintf(
$tpl,
$image,
$field['multiple'] ? 'checkbox' : 'radio',
$field['field_name'],
$value,
checked( in_array( $value, $meta ), true, false )
);
}
return implode( ' ', $html );
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field['field_name'] .= $field['multiple'] ? '[]' : '';
return $field;
}
/**
* Output the field value
* Display unordered list of images with option for size and link to full size
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
* @return mixed Field value
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
if ( ! $value )
return '';
if ( $field['clone'] )
{
$output = '<ul>';
if ( $field['multiple'] )
{
foreach ( $value as $subvalue )
{
$output .= '<li><ul>';
foreach ( $subvalue as $option )
{
$output .= sprintf( '<li><img src="%s"></li>', esc_url( $field['options'][$option] ) );
}
$output .= '</ul></li>';
}
}
else
{
foreach ( $value as $subvalue )
{
$output .= sprintf( '<li><img src="%s"></li>', esc_url( $field['options'][$subvalue] ) );
}
}
$output .= '</ul>';
}
else
{
if ( $field['multiple'] )
{
$output = '<ul>';
foreach ( $value as $subvalue )
{
$output .= sprintf( '<li><img src="%s"></li>', esc_url( $field['options'][$subvalue] ) );
}
$output .= '</ul>';
}
else
{
$output = sprintf( '<img src="%s">', esc_url( $field['options'][$value] ) );
}
}
return $output;
}
}
@@ -0,0 +1,30 @@
<?php
/**
* File advanced field class which users WordPress media popup to upload and select files.
*/
class MASHSB_RWMB_Image_Upload_Field extends MASHSB_RWMB_Image_Advanced_Field
{
/**
* Add actions
*
* @return void
*/
static function add_actions()
{
parent::add_actions();
// Print attachment templates
add_action( 'print_media_templates', array( 'MASHSB_RWMB_File_Upload_Field', 'print_templates' ) );
}
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
parent::admin_enqueue_scripts();
MASHSB_RWMB_File_Upload_Field::admin_enqueue_scripts();
wp_enqueue_script( 'mashsb-rwmb-image-upload', MASHSB_RWMB_JS_URL . 'image-upload.js', array( 'mashsb-rwmb-file-upload', 'mashsb-rwmb-image-advanced' ), MASHSB_RWMB_VER, true );
}
}
@@ -0,0 +1,234 @@
<?php
/**
* Image field class which uses <input type="file"> to upload.
*/
class MASHSB_RWMB_Image_Field extends MASHSB_RWMB_File_Field
{
/**
* Enqueue scripts and styles.
*/
static function admin_enqueue_scripts()
{
// Enqueue same scripts and styles as for file field
parent::admin_enqueue_scripts();
wp_enqueue_style( 'mashsb-rwmb-image', MASHSB_RWMB_CSS_URL . 'image.css', array(), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-image', MASHSB_RWMB_JS_URL . 'image.js', array( 'jquery-ui-sortable' ), MASHSB_RWMB_VER, true );
}
/**
* Add custom actions.
*/
static function add_actions()
{
// Do same actions as file field
parent::add_actions();
// Reorder images via Ajax
add_action( 'wp_ajax_rwmb_reorder_images', array( __CLASS__, 'wp_ajax_reorder_images' ) );
}
/**
* Ajax callback for reordering images.
*/
static function wp_ajax_reorder_images()
{
$post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_SANITIZE_NUMBER_INT );
$field_id = (string) filter_input( INPUT_POST, 'field_id' );
$order = (string) filter_input( INPUT_POST, 'order' );
check_ajax_referer( "mashsb-rwmb-reorder-images_{$field_id}" );
parse_str( $order, $items );
delete_post_meta( $post_id, $field_id );
foreach ( $items['item'] as $item )
{
add_post_meta( $post_id, $field_id, $item, false );
}
wp_send_json_success();
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
$i18n_title = apply_filters( 'rwmb_image_upload_string', _x( 'Upload Images', 'image upload', 'meta-box' ), $field );
$i18n_more = apply_filters( 'rwmb_image_add_string', _x( '+ Add new image', 'image upload', 'meta-box' ), $field );
// Uploaded images
$html = self::get_uploaded_images( $meta, $field );
// Show form upload
$html .= sprintf(
'<h4>%s</h4>
<div class="new-files">
<div class="file-input"><input type="file" name="%s[]" /></div>
<a class="mashsb-rwmb-add-file" href="#"><strong>%s</strong></a>
</div>',
$i18n_title,
$field['id'],
$i18n_more
);
return $html;
}
/**
* Get HTML markup for uploaded images
*
* @param array $images
* @param array $field
*
* @return string
*/
static function get_uploaded_images( $images, $field )
{
$reorder_nonce = wp_create_nonce( "mashsb-rwmb-reorder-images_{$field['id']}" );
$delete_nonce = wp_create_nonce( "mashsb-rwmb-delete-file_{$field['id']}" );
$classes = array( 'mashsb-rwmb-images', 'mashsb-rwmb-uploaded' );
if ( count( $images ) <= 0 )
$classes[] = 'hidden';
$list = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s">';
$html = sprintf(
$list,
implode( ' ', $classes ),
$field['id'],
$delete_nonce,
$reorder_nonce,
$field['force_delete'] ? 1 : 0,
$field['max_file_uploads']
);
foreach ( $images as $image )
{
$html .= self::img_html( $image );
}
$html .= '</ul>';
return $html;
}
/**
* Get HTML markup for ONE uploaded image
*
* @param int $image Image ID
* @return string
*/
static function img_html( $image )
{
$i18n_delete = apply_filters( 'rwmb_image_delete_string', _x( 'Delete', 'image upload', 'meta-box' ) );
$i18n_edit = apply_filters( 'rwmb_image_edit_string', _x( 'Edit', 'image upload', 'meta-box' ) );
$item = '
<li id="item_%s">
<img src="%s" />
<div class="mashsb-rwmb-image-bar">
<a title="%s" class="mashsb-rwmb-edit-file" href="%s" target="_blank" rel="noopener">%s</a> |
<a title="%s" class="mashsb-rwmb-delete-file" href="#" data-attachment_id="%s">&times;</a>
</div>
</li>
';
$src = wp_get_attachment_image_src( $image, 'thumbnail' );
$src = $src[0];
$link = get_edit_post_link( $image );
return sprintf(
$item,
$image,
$src,
$i18n_edit, $link, $i18n_edit,
$i18n_delete, $image
);
}
/**
* Output the field value
* Display unordered list of images with option for size and link to full size
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
if ( ! $value )
return '';
$output = '<ul>';
foreach ( $value as $file_info )
{
$img = sprintf(
'<img src="%s" alt="%s" title="%s">',
esc_url( $file_info['url'] ),
esc_attr( $file_info['alt'] ),
esc_attr( $file_info['title'] )
);
// Link thumbnail to full size image?
if ( isset( $args['link'] ) && $args['link'] )
{
$img = sprintf(
'<a href="%s" title="%s">%s</a>',
esc_url( $file_info['full_url'] ),
esc_attr( $file_info['title'] ),
$img
);
}
$output .= "<li>$img</li>";
}
$output .= '</ul>';
return $output;
}
/**
* Get uploaded file information
*
* @param int $file_id Attachment image ID (post ID). Required.
* @param array $args Array of arguments (for size).
*
* @return array|bool False if file not found. Array of image info on success
*/
static function file_info( $file_id, $args = array() )
{
$args = wp_parse_args( $args, array(
'size' => 'thumbnail',
) );
$img_src = wp_get_attachment_image_src( $file_id, $args['size'] );
if ( ! $img_src )
{
return false;
}
$attachment = get_post( $file_id );
$path = get_attached_file( $file_id );
$info = array(
'ID' => $file_id,
'name' => basename( $path ),
'path' => $path,
'url' => $img_src[0],
'width' => $img_src[1],
'height' => $img_src[2],
'full_url' => wp_get_attachment_url( $file_id ),
'title' => $attachment->post_title,
'caption' => $attachment->post_excerpt,
'description' => $attachment->post_content,
'alt' => get_post_meta( $file_id, '_wp_attachment_image_alt', true ),
);
if ( function_exists( 'wp_get_attachment_image_srcset' ) )
{
$info['srcset'] = wp_get_attachment_image_srcset( $file_id );
}
return $info;
}
}
@@ -0,0 +1,91 @@
<?php
/**
* Input list field.
*/
class MASHSB_RWMB_Input_List_Field extends MASHSB_RWMB_Choice_Field
{
/**
* Enqueue scripts and styles
*/
public static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-input-list', MASHSB_RWMB_CSS_URL . 'input-list.css', array(), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-input-list', MASHSB_RWMB_JS_URL . 'input-list.js', array(), MASHSB_RWMB_VER, true );
}
/**
* Walk options
*
* @param mixed $meta
* @param array $field
* @param mixed $options
* @param mixed $db_fields
*
* @return string
*/
public static function walk( $options, $db_fields, $meta, $field )
{
$walker = new MASHSB_RWMB_Input_List_Walker( $db_fields, $field, $meta );
$output = sprintf( '<ul class="mashsb-rwmb-input-list %s">', $field['collapse'] ? 'collapse' : '' );
$output .= $walker->walk( $options, $field['flatten'] ? - 1 : 0 );
$output .= '</ul>';
return $output;
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize( $field )
{
$field = $field['multiple'] ? MASHSB_RWMB_Multiple_Values_Field::normalize( $field ) : $field;
$field = MASHSB_RWMB_Input_Field::normalize( $field );
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'collapse' => true,
) );
$field['flatten'] = $field['multiple'] ? $field['flatten'] : true;
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
public static function get_attributes( $field, $value = null )
{
$attributes = MASHSB_RWMB_Input_Field::get_attributes( $field, $value );
$attributes['id'] = false;
$attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
$attributes['value'] = $value;
return $attributes;
}
/**
* Output the field value
* Display option name instead of option value
*
* @use self::meta()
*
* @param array $field Field parameters
* @param array $args Additional arguments. Rarely used. See specific fields for details
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
public static function the_value( $field, $args = array(), $post_id = null )
{
$value = parent::get_value( $field, $args, $post_id );
return empty( $value ) ? '' : $field['options'][$value];
}
}
@@ -0,0 +1,83 @@
<?php
/**
* Abstract input field class which is used for all <input> fields.
*/
abstract class MASHSB_RWMB_Input_Field extends MASHSB_RWMB_Field
{
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function html( $meta, $field )
{
$attributes = call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'get_attributes' ), $field, $meta );
return sprintf( '<input %s>%s', self::render_attributes( $attributes ), self::datalist_html( $field ) );
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'datalist' => false,
'readonly' => false,
) );
if ( $field['datalist'] )
{
$field['datalist'] = wp_parse_args( $field['datalist'], array(
'id' => $field['id'] . '_list',
'options' => array(),
) );
}
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes = wp_parse_args( $attributes, array(
'list' => $field['datalist'] ? $field['datalist']['id'] : false,
'readonly' => $field['readonly'],
'value' => $value,
'placeholder' => $field['placeholder'],
) );
return $attributes;
}
/**
* Create datalist, if any
*
* @param array $field
* @return array
*/
static function datalist_html( $field )
{
if ( empty( $field['datalist'] ) )
return '';
$datalist = $field['datalist'];
$html = sprintf( '<datalist id="%s">', $datalist['id'] );
foreach ( $datalist['options'] as $option )
{
$html .= sprintf( '<option value="%s"></option>', $option );
}
$html .= '</datalist>';
return $html;
}
}
@@ -0,0 +1,149 @@
<?php
/**
* Key-value field class.
*/
abstract class MASHSB_RWMB_Key_Value_Field extends MASHSB_RWMB_Text_Field
{
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function html( $meta, $field )
{
// Key
$key = isset( $meta[0] ) ? $meta[0] : '';
$attributes = self::get_attributes( $field, $key );
$attributes['placeholder'] = esc_attr__( 'Key', 'meta-box' );
$html = sprintf( '<input %s>', self::render_attributes( $attributes ) );
// Value
$val = isset( $meta[1] ) ? $meta[1] : '';
$attributes = self::get_attributes( $field, $val );
$attributes['placeholder'] = esc_attr__( 'Value', 'meta-box' );
$html .= sprintf( '<input %s>', self::render_attributes( $attributes ) );
return $html;
}
/**
* Show begin HTML markup for fields
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function begin_html( $meta, $field )
{
$desc = $field['desc'] ? "<p id='{$field['id']}_description' class='description'>{$field['desc']}</p>" : '';
if ( empty( $field['name'] ) )
return '<div class="mashsb-rwmb-input">' . $desc;
return sprintf(
'<div class="mashsb-rwmb-label">
<label for="%s">%s</label>
</div>
<div class="mashsb-rwmb-input">
%s',
$field['id'],
$field['name'],
$desc
);
}
/**
* Show end HTML markup for fields
* Do not show field description. Field description is shown before list of fields
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function end_html( $meta, $field )
{
$button = $field['clone'] ? self::add_clone_button( $field ) : '';
$html = "$button</div>";
return $html;
}
/**
* Escape meta for field output
*
* @param mixed $meta
* @return mixed
*/
static function esc_meta( $meta )
{
foreach ( (array) $meta as $k => $pairs )
{
$meta[$k] = array_map( 'esc_attr', (array) $pairs );
}
return $meta;
}
/**
* Sanitize field value.
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return string
*/
static function value( $new, $old, $post_id, $field )
{
foreach ( $new as &$arr )
{
if ( empty( $arr[0] ) && empty( $arr[1] ) )
$arr = false;
}
$new = array_filter( $new );
return $new;
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field['clone'] = true;
$field['multiple'] = true;
return $field;
}
/**
* Output the field value
* Display unordered list of key - value pairs
*
* @use self::get_value()
* @see rwmb_the_value()
*
* @param array $field Field parameters
* @param array $args Additional arguments. Rarely used. See specific fields for details
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return string HTML output of the field
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
if ( ! is_array( $value ) )
return '';
$output = '<ul>';
foreach ( $value as $subvalue )
{
$output .= sprintf( '<li><label>%s</label>: %s</li>', $subvalue[0], $subvalue[1] );
}
$output .= '</ul>';
return $output;
}
}
@@ -0,0 +1,162 @@
<?php
/**
* Map field class.
*/
class MASHSB_RWMB_Map_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
/**
* Allows developers load more libraries via a filter.
* @link https://developers.google.com/maps/documentation/javascript/libraries
*/
$google_maps_url = apply_filters( 'rwmb_google_maps_url', 'https://maps.google.com/maps/api/js?sensor=false' );
wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), '', true );
wp_enqueue_style( 'mashsb-rwmb-map', MASHSB_RWMB_CSS_URL . 'map.css' );
wp_enqueue_script( 'mashsb-rwmb-map', MASHSB_RWMB_JS_URL . 'map.js', array( 'jquery-ui-autocomplete', 'google-maps' ), MASHSB_RWMB_VER, true );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
$html = '<div class="mashsb-rwmb-map-field">';
$html .= sprintf(
'<div class="mashsb-rwmb-map-canvas" data-default-loc="%s"></div>
<input type="hidden" name="%s" class="mashsb-rwmb-map-coordinate" value="%s">',
esc_attr( $field['std'] ),
esc_attr( $field['field_name'] ),
esc_attr( $meta )
);
if ( $address = $field['address_field'] )
{
$html .= sprintf(
'<button class="button mashsb-rwmb-map-goto-address-button" value="%s">%s</button>',
is_array( $address ) ? implode( ',', $address ) : $address,
__( 'Find Address', 'meta-box' )
);
}
$html .= '</div>';
return $html;
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'std' => '',
'address_field' => '',
) );
return $field;
}
/**
* Get the field value
* The difference between this function and 'meta' function is 'meta' function always returns the escaped value
* of the field saved in the database, while this function returns more meaningful value of the field
*
* @param array $field Field parameters
* @param array $args Not used for this field
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Array(latitude, longitude, zoom)
*/
static function get_value( $field, $args = array(), $post_id = null )
{
$value = parent::get_value( $field, $args, $post_id );
list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' );
return compact( 'latitude', 'longitude', 'zoom' );
}
/**
* Output the field value
* Display Google maps
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
if ( ! $value['latitude'] || ! $value['longitude'] )
{
return '';
}
if ( ! $value['zoom'] )
{
$value['zoom'] = 14;
}
/**
* Enqueue scripts
* Note: We still can enqueue script which outputs in the footer
*/
/**
* Allows developers load more libraries via a filter.
* @link https://developers.google.com/maps/documentation/javascript/libraries
*/
$google_maps_url = apply_filters( 'rwmb_google_maps_url', 'https://maps.google.com/maps/api/js?sensor=false' );
wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), '', true );
wp_enqueue_script( 'mashsb-rwmb-map-frontend', MASHSB_RWMB_JS_URL . 'map-frontend.js', array( 'google-maps' ), '', true );
// Map parameters
$args = wp_parse_args( $args, array(
'latitude' => $value['latitude'],
'longitude' => $value['longitude'],
'width' => '100%',
'height' => '480px',
'marker' => true, // Display marker?
'marker_title' => '', // Marker title, when hover
'info_window' => '', // Content of info window (when click on marker). HTML allowed
'js_options' => array(),
) );
/**
* Google Maps options
* Option name is the same as specified in Google Maps documentation
* This array will be convert to Javascript Object and pass as map options
* @link https://developers.google.com/maps/documentation/javascript/reference
*/
$args['js_options'] = wp_parse_args( $args['js_options'], array(
// Default to 'zoom' level set in admin, but can be overwritten
'zoom' => $value['zoom'],
// Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId
'mapTypeId' => 'ROADMAP',
) );
$output = sprintf(
'<div class="mashsb-rwmb-map-canvas" data-map_options="%s" style="width:%s;height:%s"></div>',
esc_attr( wp_json_encode( $args ) ),
esc_attr( $args['width'] ),
esc_attr( $args['height'] )
);
return $output;
}
}
@@ -0,0 +1,152 @@
<?php
/**
* Media field class which users WordPress media popup to upload and select files.
*/
class MASHSB_RWMB_Media_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
wp_enqueue_media();
wp_enqueue_style( 'mashsb-rwmb-media', MASHSB_RWMB_CSS_URL . 'media.css', array(), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-media', MASHSB_RWMB_JS_URL . 'media.js', array( 'jquery-ui-sortable', 'underscore', 'backbone' ), MASHSB_RWMB_VER, true );
wp_localize_script( 'mashsb-rwmb-media', 'i18nRwmbMedia', array(
'add' => apply_filters( 'rwmb_media_add_string', _x( 'Add Image', 'media', 'meta-box' ) ),
'single' => apply_filters( 'rwmb_media_single_files_string', _x( ' file', 'media', 'meta-box' ) ),
'multiple' => apply_filters( 'rwmb_media_multiple_files_string', _x( ' files', 'media', 'meta-box' ) ),
'remove' => apply_filters( 'rwmb_media_remove_string', _x( 'Remove', 'media', 'meta-box' ) ),
'edit' => apply_filters( 'rwmb_media_edit_string', _x( 'Edit', 'media', 'meta-box' ) ),
'view' => apply_filters( 'rwmb_media_view_string', _x( 'View', 'media', 'meta-box' ) ),
'noTitle' => _x( 'No Title', 'media', 'meta-box' ),
'loadingUrl' => MASHSB_RWMB_URL . 'img/loader.gif',
'extensions' => self::get_mime_extensions(),
'select' => _x( 'Select Files', 'media', 'meta-box' ),
'uploadInstructions' => _x( 'Drop files here to upload', 'media', 'meta-box' )
) );
}
/**
* Add actions
*
* @return void
*/
static function add_actions()
{
// Print attachment templates
add_action( 'print_media_templates', array( __CLASS__, 'print_templates' ) );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
$meta = (array) $meta;
$meta = implode( ',', $meta );
$attributes = self::get_attributes( $field, $meta );
$html = sprintf(
'<input %s>
<div class="mashsb-rwmb-media-view" data-mime-type="%s" data-max-files="%s" data-force-delete="%s"></div>',
self::render_attributes( $attributes ),
$field['mime_type'],
$field['max_file_uploads'],
$field['force_delete'] ? 'true' : 'false'
);
return $html;
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'std' => array(),
'mime_type' => '',
'max_file_uploads' => 0,
'force_delete' => false,
) );
$field['multiple'] = true;
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['type'] = 'hidden';
$attributes['name'] .= ! $field['clone'] && $field['multiple'] ? '[]' : '';
$attributes['disabled'] = true;
$attributes['id'] = false;
$attributes['value'] = $value;
return $attributes;
}
static function get_mime_extensions()
{
$mime_types = wp_get_mime_types();
$extensions = array();
foreach( $mime_types as $ext => $mime )
{
$ext = explode( '|', $ext );
$extensions[ $mime ] = $ext;
$mime_parts = explode( '/', $mime );
if( empty( $extensions[ $mime_parts[0] ] ) )
$extensions[ $mime_parts[0] ] = array();
$extensions[ $mime_parts[0] ] = $extensions[ $mime_parts[0] . '/*' ] = array_merge( $extensions[ $mime_parts[0] ], $ext );
}
return $extensions;
}
/**
* Save meta value
*
* @param $new
* @param $old
* @param $post_id
* @param $field
*/
static function save( $new, $old, $post_id, $field )
{
delete_post_meta( $post_id, $field['id'] );
parent::save( $new, array(), $post_id, $field );
}
/**
* Template for media item
* @return void
*/
static function print_templates()
{
require_once( MASHSB_RWMB_INC_DIR . 'templates/media.php' );
}
}
@@ -0,0 +1,73 @@
<?php
/**
* This class implements common methods used in fields which have multiple values
* like checkbox list, autocomplete, etc.
*
* The difference when handling actions for these fields are the way they get/set
* meta value. Briefly:
* - If field is cloneable, value is saved as a single entry in the database
* - Otherwise value is saved as multiple entries
*/
abstract class MASHSB_RWMB_Multiple_Values_Field extends MASHSB_RWMB_Field
{
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field['multiple'] = true;
$field['field_name'] = $field['id'];
if ( ! $field['clone'] )
$field['field_name'] .= '[]';
return $field;
}
/**
* Output the field value
* Display option name instead of option value
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
if ( ! $value )
return '';
$output = '<ul>';
if ( $field['clone'] )
{
foreach ( $value as $subvalue )
{
$output .= '<li>';
$output .= '<ul>';
foreach ( $subvalue as $option )
{
$output .= '<li>' . $field['options'][$option] . '</li>';
}
$output .= '</ul>';
$output .= '</li>';
}
}
else
{
foreach ( $value as $option )
{
$output .= '<li>' . $field['options'][$option] . '</li>';
}
}
$output .= '</ul>';
return $output;
}
}
@@ -0,0 +1,47 @@
<?php
/**
* Number field class.
*/
class MASHSB_RWMB_Number_Field extends MASHSB_RWMB_Input_Field
{
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'step' => 1,
'min' => 0,
'max' => false,
) );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes = wp_parse_args( $attributes, array(
'step' => $field['step'],
'max' => $field['max'],
'min' => $field['min'],
) );
$attributes['type'] = 'number';
return $attributes;
}
}
@@ -0,0 +1,145 @@
<?php
/**
* Abstract field to select an object: post, user, taxonomy, etc.
*/
abstract class MASHSB_RWMB_Object_Choice_Field extends MASHSB_RWMB_Choice_Field
{
/**
* Get field HTML
*
* @param mixed $options
* @param mixed $db_fields
* @param mixed $meta
* @param array $field
* @return string
*/
public static function walk( $options, $db_fields, $meta, $field )
{
switch ( $field['field_type'] )
{
case 'checkbox_list':
case 'radio_list':
return MASHSB_RWMB_Input_List_Field::walk( $options, $db_fields, $meta, $field );
break;
case 'select_tree':
return MASHSB_RWMB_Select_Tree_Field::walk( $options, $db_fields, $meta, $field );
break;
case 'select_advanced':
return MASHSB_RWMB_Select_Advanced_Field::walk( $options, $db_fields, $meta, $field );
break;
case 'select':
default:
return MASHSB_RWMB_Select_Field::walk( $options, $db_fields, $meta, $field );
break;
}
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
public static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'flatten' => true,
'query_args' => array(),
'field_type' => 'select_advanced',
) );
if ( 'checkbox_tree' === $field['field_type'] )
{
$field['field_type'] = 'checkbox_list';
$field['flatten'] = false;
}
switch ( $field['field_type'] )
{
case 'checkbox_list':
case 'radio_list':
$field['multiple'] = 'radio_list' === $field['field_type'] ? false : true;
return MASHSB_RWMB_Input_List_Field::normalize( $field );
break;
case 'select_advanced':
return MASHSB_RWMB_Select_Advanced_Field::normalize( $field );
break;
case 'select_tree':
return MASHSB_RWMB_Select_Tree_Field::normalize( $field );
break;
case 'select':
default:
return MASHSB_RWMB_Select_Field::normalize( $field );
break;
}
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
public static function get_attributes( $field, $value = null )
{
switch ( $field['field_type'] )
{
case 'checkbox_list':
case 'radio_list':
return MASHSB_RWMB_Input_List_Field::get_attributes( $field, $value );
break;
case 'select_advanced':
$attributes = MASHSB_RWMB_Select_Advanced_Field::get_attributes( $field, $value );
$attributes['class'] .= ' mashsb-rwmb-select_advanced';
return $attributes;
break;
case 'select_tree':
return MASHSB_RWMB_Select_Tree_Field::get_attributes( $field, $value );
break;
case 'select':
default:
return MASHSB_RWMB_Select_Field::get_attributes( $field, $value );
break;
}
}
/**
* Get field names of object to be used by walker
* @return array
*/
public static function get_db_fields()
{
return array(
'parent' => '',
'id' => '',
'label' => '',
);
}
/**
* Enqueue scripts and styles
*/
public static function admin_enqueue_scripts()
{
MASHSB_RWMB_Input_List_Field::admin_enqueue_scripts();
MASHSB_RWMB_Select_Field::admin_enqueue_scripts();
MASHSB_RWMB_Select_Tree_Field::admin_enqueue_scripts();
MASHSB_RWMB_Select_Advanced_Field::admin_enqueue_scripts();
}
/**
* Get options for walker
*
* @param array $field
*
* @return array
*/
public static function get_options( $field )
{
return array();
}
}
@@ -0,0 +1,122 @@
<?php
/**
* oEmbed field class.
*/
class MASHSB_RWMB_OEmbed_Field extends MASHSB_RWMB_URL_Field
{
/**
* Enqueue scripts and styles
*/
public static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-oembed', MASHSB_RWMB_CSS_URL . 'oembed.css' );
wp_enqueue_script( 'mashsb-rwmb-oembed', MASHSB_RWMB_JS_URL . 'oembed.js', array(), MASHSB_RWMB_VER, true );
}
/**
* Add actions
*/
public static function add_actions()
{
add_action( 'wp_ajax_rwmb_get_embed', array( __CLASS__, 'wp_ajax_get_embed' ) );
}
/**
* Ajax callback for returning oEmbed HTML
*/
public static function wp_ajax_get_embed()
{
$url = (string) filter_input( INPUT_POST, 'url', FILTER_SANITIZE_URL );
wp_send_json_success( self::get_embed( $url ) );
}
/**
* Get embed html from url
*
* @param string $url
* @return string
*/
public static function get_embed( $url )
{
/**
* Set arguments for getting embeded HTML.
* Without arguments, default width will be taken from global $content_width, which can break UI in the admin
* @link https://github.com/rilwis/meta-box/issues/801
* @see WP_oEmbed::fetch()
* @see WP_Embed::shortcode()
* @see wp_embed_defaults()
*/
$args = array();
if ( is_admin() )
{
$args['width'] = 360;
}
// Try oembed first
$embed = wp_oembed_get( $url, $args );
// If no oembed provides found, try WordPress auto embed
if ( ! $embed )
{
$embed = $GLOBALS['wp_embed']->shortcode( $args, $url );
}
return $embed ? $embed : __( 'Embed HTML not available.', 'meta-box' );
}
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
public static function html( $meta, $field )
{
$attributes = self::get_attributes( $field, $meta );
return sprintf(
'<input %s>
<a href="#" class="show-embed button">%s</a>
<span class="spinner"></span>
<div class="embed-code">%s</div>',
self::render_attributes( $attributes ),
__( 'Preview', 'meta-box' ),
$meta ? self::get_embed( $meta ) : ''
);
}
/**
* Output the field value
* Display embed media
*
* @param array $field Field parameters
* @param array $args Additional arguments. Not used for these fields.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return mixed Field value
*/
public static function the_value( $field, $args = array(), $post_id = null )
{
$value = self::get_value( $field, $args, $post_id );
$output = '';
if ( empty( $value ) )
{
return $output;
}
if ( $field['clone'] )
{
$output = '<ul>';
foreach ( $value as $subvalue )
{
$output .= '<li>' . self::get_embed( $subvalue ) . '</li>';
}
$output .= '</ul>';
}
else
{
$output = self::get_embed( $value );
}
return $output;
}
}
@@ -0,0 +1,34 @@
<?php
/**
* Password field class.
*/
class MASHSB_RWMB_Password_Field extends MASHSB_RWMB_Text_Field
{
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['type'] = 'password';
return $attributes;
}
/**
* Store secured password in the database.
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
* @return string
*/
static function value( $new, $old, $post_id, $field )
{
$new = $new != $old ? wp_hash_password( $new ) : $new;
return $new;
}
}
@@ -0,0 +1,5 @@
<?php
/**
* Image upload field which uses plupload library to drag and drop files to upload.
*/
class MASHSB_RWMB_Plupload_Image_Field extends MASHSB_RWMB_Image_Upload_Field {}
@@ -0,0 +1,132 @@
<?php
/**
* Post field class.
*/
class MASHSB_RWMB_Post_Field extends MASHSB_RWMB_Object_Choice_Field
{
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize( $field )
{
/**
* Set default field args
*/
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'post_type' => 'post',
'parent' => false,
) );
if ( ! isset( $field['query_args']['post_type'] ) )
$field['query_args']['post_type'] = $field['post_type'];
/**
* Set default placeholder
* - If multiple post types: show 'Select a post'
* - If single post type: show 'Select a %post_type_name%'
*/
if ( empty( $field['placeholder'] ) )
{
$field['placeholder'] = __( 'Select a post', 'meta-box' );
if ( is_string( $field['query_args']['post_type'] ) && post_type_exists( $field['query_args']['post_type'] ) )
{
$post_type_object = get_post_type_object( $field['query_args']['post_type'] );
$field['placeholder'] = sprintf( __( 'Select a %s', 'meta-box' ), $post_type_object->labels->singular_name );
}
}
/**
* Set parent option, which will change field name to `parent_id` to save as post parent
*/
if ( $field['parent'] )
{
$field['multiple'] = false;
$field['field_name'] = 'parent_id';
}
/**
* Set default query args
*/
$field['query_args'] = wp_parse_args( $field['query_args'], array(
'post_status' => 'publish',
'posts_per_page' => - 1,
) );
return $field;
}
/**
* Get field names of object to be used by walker
*
* @return array
*/
public static function get_db_fields()
{
return array(
'parent' => 'post_parent',
'id' => 'ID',
'label' => 'post_title',
);
}
/**
* Get meta value
* If field is cloneable, value is saved as a single entry in DB
* Otherwise value is saved as multiple entries (for backward compatibility)
*
* @see "save" method for better understanding
*
* @param $post_id
* @param $saved
* @param $field
*
* @return array
*/
public static function meta( $post_id, $saved, $field )
{
if ( isset( $field['parent'] ) && $field['parent'] )
{
$post = get_post( $post_id );
return $post->post_parent;
}
return parent::meta( $post_id, $saved, $field );
}
/**
* Get options for walker
*
* @param array $field
* @return array
*/
public static function get_options( $field )
{
$query = new WP_Query( $field['query_args'] );
return $query->have_posts() ? $query->posts : array();
}
/**
* Get option label
*
* @param string $value Option value
* @param array $field Field parameter
*
* @return string
*/
public static function get_option_label( $value, $field )
{
return sprintf(
'<a href="%s" title="%s">%s</a>',
esc_url( get_permalink( $value ) ),
the_title_attribute( array(
'post' => $value,
'echo' => false,
) ),
get_the_title( $value )
);
}
}
@@ -0,0 +1,19 @@
<?php
/**
* Radio field class.
*/
class MASHSB_RWMB_Radio_Field extends MASHSB_RWMB_Input_List_Field
{
/**
* Normalize parameters for field
* @param array $field
* @return array
*/
static function normalize( $field )
{
$field['multiple'] = false;
$field = parent::normalize( $field );
return $field;
}
}
@@ -0,0 +1,93 @@
<?php
/**
* HTML5 range field class.
*/
class MASHSB_RWMB_Range_Field extends MASHSB_RWMB_Number_Field
{
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
* @return string
*/
static function html( $meta, $field )
{
$output = parent::html( $meta, $field );
$output .= sprintf( '<span class="mashsb-rwmb-output">%s</span>', $meta );
return $output;
}
/**
* Enqueue styles
*/
static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-range', MASHSB_RWMB_CSS_URL . 'range.css', array(), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-range', MASHSB_RWMB_JS_URL . 'range.js', array(), MASHSB_RWMB_VER, true );
}
/**
* Normalize parameters for field.
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = wp_parse_args( $field, array(
'min' => 0,
'max' => 10,
'step' => 1,
) );
$field = parent::normalize( $field );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['type'] = 'range';
return $attributes;
}
/**
* Ensure number in range.
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return int
*/
static function value( $new, $old, $post_id, $field )
{
$new = intval( $new );
$min = intval( $field['min'] );
$max = intval( $field['max'] );
if ( $new < $min )
{
return $min;
}
elseif ( $new > $max )
{
return $max;
}
return $new;
}
}
@@ -0,0 +1,102 @@
<?php
/**
* Select advanced field which uses select2 library.
*/
class MASHSB_RWMB_Select_Advanced_Field extends MASHSB_RWMB_Select_Field
{
/**
* Enqueue scripts and styles
*/
public static function admin_enqueue_scripts()
{
parent::admin_enqueue_scripts();
wp_enqueue_style( 'mashsb-rwmb-select2', MASHSB_RWMB_CSS_URL . 'select2/select2.css', array(), '4.0.1' );
wp_enqueue_style( 'mashsb-rwmb-select-advanced', MASHSB_RWMB_CSS_URL . 'select-advanced.css', array(), MASHSB_RWMB_VER );
wp_register_script( 'mashsb-rwmb-select2', MASHSB_RWMB_JS_URL . 'select2/select2.min.js', array(), '4.0.2', true );
//Localize
$deps = array( 'mashsb-rwmb-select2', 'mashsb-rwmb-select' );
$dir = MASHSB_RWMB_JS_URL . 'select2/i18n/';
$file = str_replace( '_', '-', get_locale() );
$parts = explode( '-', $file );
$file = file_exists( MASHSB_RWMB_DIR . 'js/select2/i18n/' . $file . '.js' ) ? $file : $parts[0];
if ( file_exists( MASHSB_RWMB_DIR . 'js/select2/i18n/' . $file . '.js' ) )
{
wp_register_script( 'mashsb-rwmb-select2-i18n', $dir . $file . '.js', array( 'mashsb-rwmb-select2' ), '4.0.2', true );
$deps[] = 'mashsb-rwmb-select2-i18n';
}
wp_enqueue_script( 'mashsb-rwmb-select', MASHSB_RWMB_JS_URL . 'select.js', array(), MASHSB_RWMB_VER, true );
wp_enqueue_script( 'mashsb-rwmb-select-advanced', MASHSB_RWMB_JS_URL . 'select-advanced.js', $deps, MASHSB_RWMB_VER, true );
}
/**
* Walk options
*
* @param mixed $meta
* @param array $field
* @param mixed $options
* @param mixed $db_fields
*
* @return string
*/
public static function walk( $options, $db_fields, $meta, $field )
{
$attributes = call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'get_attributes' ), $field, $meta );
$walker = new MASHSB_RWMB_Select_Walker( $db_fields, $field, $meta );
$output = sprintf(
'<select %s>',
self::render_attributes( $attributes )
);
$output .= '<option></option>';
$output .= $walker->walk( $options, $field['flatten'] ? - 1 : 0 );
$output .= '</select>';
$output .= self::get_select_all_html( $field );
return $output;
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize( $field )
{
$field = wp_parse_args( $field, array(
'js_options' => array(),
'placeholder' => 'Select an item',
) );
$field = parent::normalize( $field );
$field['js_options'] = wp_parse_args( $field['js_options'], array(
'allowClear' => true,
'width' => 'none',
'placeholder' => $field['placeholder'],
) );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
* @return array
*/
public static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes = wp_parse_args( $attributes, array(
'data-options' => wp_json_encode( $field['js_options'] ),
) );
return $attributes;
}
}
@@ -0,0 +1,64 @@
<?php
/**
* Select tree field class.
*/
class MASHSB_RWMB_Select_Tree_Field extends MASHSB_RWMB_Select_Field
{
/**
* Walk options
*
* @param mixed $meta
* @param array $field
* @param mixed $options
* @param mixed $db_fields
*
* @return string
*/
public static function walk( $options, $db_fields, $meta, $field )
{
$walker = new MASHSB_RWMB_Select_Tree_Walker( $db_fields, $field, $meta );
return $walker->walk( $options );
}
/**
* Enqueue scripts and styles
*/
public static function admin_enqueue_scripts()
{
parent::admin_enqueue_scripts();
wp_enqueue_style( 'mashsb-rwmb-select-tree', MASHSB_RWMB_CSS_URL . 'select-tree.css', array( 'mashsb-rwmb-select' ), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-select-tree', MASHSB_RWMB_JS_URL . 'select-tree.js', array( 'mashsb-rwmb-select' ), MASHSB_RWMB_VER, true );
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize( $field )
{
$field['multiple'] = true;
$field['size'] = 0;
$field = parent::normalize( $field );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
public static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes['multiple'] = false;
$attributes['id'] = false;
return $attributes;
}
}
@@ -0,0 +1,95 @@
<?php
/**
* Select field class.
*/
class MASHSB_RWMB_Select_Field extends MASHSB_RWMB_Choice_Field
{
/**
* Enqueue scripts and styles
*/
public static function admin_enqueue_scripts()
{
wp_enqueue_style( 'mashsb-rwmb-select', MASHSB_RWMB_CSS_URL . 'select.css', array(), MASHSB_RWMB_VER );
wp_enqueue_script( 'mashsb-rwmb-select', MASHSB_RWMB_JS_URL . 'select.js', array(), MASHSB_RWMB_VER, true );
}
/**
* Walk options
*
* @param mixed $meta
* @param array $field
* @param mixed $options
* @param mixed $db_fields
*
* @return string
*/
public static function walk( $options, $db_fields, $meta, $field )
{
$attributes = call_user_func( array( MASHSB_RW_Meta_Box::get_class_name( $field ), 'get_attributes' ), $field, $meta );
$walker = new MASHSB_RWMB_Select_Walker( $db_fields, $field, $meta );
$output = sprintf(
'<select %s>',
self::render_attributes( $attributes )
);
if ( false === $field['multiple'] )
{
$output .= isset( $field['placeholder'] ) ? "<option value=''>{$field['placeholder']}</option>" : '<option></option>';
}
$output .= $walker->walk( $options, $field['flatten'] ? - 1 : 0 );
$output .= '</select>';
$output .= self::get_select_all_html( $field );
return $output;
}
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize( $field )
{
$field = parent::normalize( $field );
$field = $field['multiple'] ? MASHSB_RWMB_Multiple_Values_Field::normalize( $field ) : $field;
$field = wp_parse_args( $field, array(
'size' => $field['multiple'] ? 5 : 0,
'select_all_none' => false,
) );
return $field;
}
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
public static function get_attributes( $field, $value = null )
{
$attributes = parent::get_attributes( $field, $value );
$attributes = wp_parse_args( $attributes, array(
'multiple' => $field['multiple'],
'size' => $field['size'],
) );
return $attributes;
}
/**
* Get html for select all|none for multiple select
*
* @param array $field
* @return string
*/
public static function get_select_all_html( $field )
{
if ( $field['multiple'] && $field['select_all_none'] )
{
return '<div class="mashsb-rwmb-select-all-none">' . __( 'Select', 'meta-box' ) . ': <a data-type="all" href="#">' . __( 'All', 'meta-box' ) . '</a> | <a data-type="none" href="#">' . __( 'None', 'meta-box' ) . '</a></div>';
}
return '';
}
}
@@ -0,0 +1,66 @@
<?php
/**
* jQueryUI slider field class.
*/
class MASHSB_RWMB_Slider_Field extends MASHSB_RWMB_Field
{
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
$url = MASHSB_RWMB_CSS_URL . 'jqueryui';
wp_enqueue_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
wp_enqueue_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array(), '1.8.17' );
wp_enqueue_style( 'mashsb-rwmb-slider', MASHSB_RWMB_CSS_URL . 'slider.css' );
wp_enqueue_script( 'mashsb-rwmb-slider', MASHSB_RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-core' ), MASHSB_RWMB_VER, true );
}
/**
* Get div HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html( $meta, $field )
{
return sprintf(
'<div class="clearfix">
<div class="mashsb-rwmb-slider" id="%s" data-options="%s"></div>
<span class="mashsb-rwmb-slider-value-label">%s<span>%s</span>%s</span>
<input type="hidden" name="%s" value="%s" class="mashsb-rwmb-slider-value">
</div>',
$field['id'], esc_attr( wp_json_encode( $field['js_options'] ) ),
$field['prefix'], $meta, $field['suffix'],
$field['field_name'], $meta
);
}
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize( $field )
{
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'prefix' => '',
'suffix' => '',
'js_options' => array(),
) );
$field['js_options'] = wp_parse_args( $field['js_options'], array(
'range' => 'min', // range = 'min' will add a dark background to sliding part, better UI
) );
return $field;
}
}
@@ -0,0 +1,89 @@
<?php
/**
* Taxonomy advanced field class which saves terms' IDs in the post meta.
*/
class MASHSB_RWMB_Taxonomy_Advanced_Field extends MASHSB_RWMB_Taxonomy_Field
{
/**
* Get meta values to save
* Save terms in custom field, no more by setting post terms
* Save in form of comma-separated IDs
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return string
*/
static function value( $new, $old, $post_id, $field )
{
return is_array( $new ) ? implode( ',', array_unique( $new ) ) : null;
}
/**
* Save meta value
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return string
*/
static function save( $new, $old, $post_id, $field )
{
if ( $new )
update_post_meta( $post_id, $field['id'], $new );
else
delete_post_meta( $post_id, $field['id'] );
}
/**
* Standard meta retrieval
*
* @param int $post_id
* @param bool $saved
* @param array $field
*
* @return array
*/
static function meta( $post_id, $saved, $field )
{
$meta = get_post_meta( $post_id, $field['id'], true );
$meta = wp_parse_id_list( $meta );
return $meta;
}
/**
* Get the field value
* Return list of post term objects
*
* @param array $field Field parameters
* @param array $args Additional arguments. Rarely used. See specific fields for details
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return array List of post term objects
*/
static function get_value( $field, $args = array(), $post_id = null )
{
if ( ! $post_id )
$post_id = get_the_ID();
$value = self::meta( $post_id, '', $field );
// Allow to pass more arguments to "get_terms"
$args = wp_parse_args( array(
'include' => $value,
'hide_empty' => false,
), $args );
$value = get_terms( $field['taxonomy'], $args );
// Get single value if necessary
if ( ! $field['clone'] && ! $field['multiple'] )
{
$value = reset( $value );
}
return $value;
}
}
@@ -0,0 +1,164 @@
<?php
/**
* Taxonomy field class which set post terms when saving.
*/
class MASHSB_RWMB_Taxonomy_Field extends MASHSB_RWMB_Object_Choice_Field
{
/**
* Add default value for 'taxonomy' field
*
* @param $field
* @return array
*/
static function normalize( $field )
{
/**
* Backwards compatibility with field args
*/
if ( isset( $field['options']['args'] ) )
$field['query_args'] = $field['options']['args'];
if ( isset( $field['options']['taxonomy'] ) )
$field['taxonomy'] = $field['options']['taxonomy'];
if ( isset( $field['options']['type'] ) )
$field['field_type'] = $field['options']['type'];
/**
* Set default field args
*/
$field = parent::normalize( $field );
$field = wp_parse_args( $field, array(
'taxonomy' => 'category',
) );
/**
* Set default query args
*/
$field['query_args'] = wp_parse_args( $field['query_args'], array(
'hide_empty' => false,
) );
/**
* Set default placeholder
* - If multiple taxonomies: show 'Select a term'
* - If single taxonomy: show 'Select a %taxonomy_name%'
*/
if ( empty( $field['placeholder'] ) )
{
$field['placeholder'] = __( 'Select a term', 'meta-box' );
if ( is_string( $field['taxonomy'] ) && taxonomy_exists( $field['taxonomy'] ) )
{
$taxonomy_object = get_taxonomy( $field['taxonomy'] );
$field['placeholder'] = sprintf( __( 'Select a %s', 'meta-box' ), $taxonomy_object->labels->singular_name );
}
}
/**
* Prevent cloning for taxonomy field
*/
$field['clone'] = false;
return $field;
}
/**
* Get field names of object to be used by walker
*
* @return array
*/
static function get_db_fields()
{
return array(
'parent' => 'parent',
'id' => 'term_id',
'label' => 'name',
);
}
/**
* Get options for selects, checkbox list, etc via the terms
*
* @param array $field Field parameters
*
* @return array
*/
static function get_options( $field )
{
$options = get_terms( $field['taxonomy'], $field['query_args'] );
return $options;
}
/**
* Save meta value
*
* @param mixed $new
* @param mixed $old
* @param int $post_id
* @param array $field
*
* @return string
*/
static function save( $new, $old, $post_id, $field )
{
$new = array_unique( array_map( 'intval', (array) $new ) );
$new = empty( $new ) ? null : $new;
wp_set_object_terms( $post_id, $new, $field['taxonomy'] );
}
/**
* Standard meta retrieval
*
* @param int $post_id
* @param bool $saved
* @param array $field
*
* @return array
*/
static function meta( $post_id, $saved, $field )
{
$meta = get_the_terms( $post_id, $field['taxonomy'] );
$meta = (array) $meta;
$meta = wp_list_pluck( $meta, 'term_id' );
return $meta;
}
/**
* Get the field value
* Return list of post term objects
*
* @param array $field Field parameters
* @param array $args Additional arguments. Rarely used. See specific fields for details
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return array List of post term objects
*/
static function get_value( $field, $args = array(), $post_id = null )
{
$value = get_the_terms( $post_id, $field['taxonomy'] );
// Get single value if necessary
if ( ! $field['clone'] && ! $field['multiple'] && is_array( $value ) )
{
$value = reset( $value );
}
return $value;
}
/**
* Get option label
*
* @param string $value Option value
* @param array $field Field parameter
*
* @return string
*/
static function get_option_label( $value, $field )
{
return sprintf(
'<a href="%s" title="%s">%s</a>',
esc_url( get_term_link( $value ) ),
esc_attr( $value->name ),
$value->name
);
}
}
Loaded 100 of 13389 files, more files were not shown because too many files have changed in this diff. Show more