Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Contextual Help
|
||||
*
|
||||
* @package MASHSB
|
||||
* @subpackage Admin/Settings
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Settings contextual help.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @return void
|
||||
*/
|
||||
function mashsb_settings_contextual_help() {
|
||||
$screen = get_current_screen();
|
||||
|
||||
/*if ( $screen->id != 'mashsb-settings' )
|
||||
return;
|
||||
*/
|
||||
$screen->set_help_sidebar(
|
||||
'<p><strong>' . $screen->id . sprintf( __( 'For more information:', 'mashsb' ) . '</strong></p>' .
|
||||
'<p>' . sprintf( __( 'Visit the <a href="%s">documentation</a> on the Mashshare website.', 'mashsb' ), esc_url( 'https://www.mashshare.net/' ) ) ) . '</p>' .
|
||||
'<p>' . sprintf(
|
||||
__( '<a href="%s">Post an issue</a> on <a href="%s">Mashshare</a>. View <a href="%s">extensions</a>.', 'mashsb' ),
|
||||
esc_url( 'https://www.mashshare.net/contact-support/' ),
|
||||
esc_url( 'https://www.mashshare.net' ),
|
||||
esc_url( 'https://www.mashshare.net/downloads' )
|
||||
) . '</p>'
|
||||
);
|
||||
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'mashsb-settings-general',
|
||||
'title' => __( 'General', 'mashsb' ),
|
||||
'content' => '<p>' . __( 'This screen provides the most basic settings for configuring Mashshare.', 'mashsb' ) . '</p>'
|
||||
) );
|
||||
|
||||
|
||||
|
||||
|
||||
do_action( 'mashsb_settings_contextual_help', $screen );
|
||||
}
|
||||
add_action( 'load-mashsb-settings', 'mashsb_settings_contextual_help' );
|
||||
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin Options Page
|
||||
*
|
||||
* @package MASHSB
|
||||
* @subpackage Admin/Settings
|
||||
* @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;
|
||||
|
||||
/* Returns list elements for jQuery tab navigation
|
||||
* based on header callback
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @todo Use sprintf to sanitize $field['id'] instead using str_replace() Should be much faster?
|
||||
* @return string
|
||||
*/
|
||||
|
||||
function getTabHeader( $page, $section ) {
|
||||
global $wp_settings_fields;
|
||||
|
||||
if( !isset( $wp_settings_fields[$page][$section] ) )
|
||||
return;
|
||||
|
||||
echo '<ul id="mashsb-tabs-sidebar">';
|
||||
foreach ( ( array ) $wp_settings_fields[$page][$section] as $field ) {
|
||||
$sanitizedID = str_replace( '[', '', $field['id'] );
|
||||
$sanitizedID = str_replace( ']', '', $sanitizedID );
|
||||
if( strpos( $field['callback'], 'header' ) !== false ) {
|
||||
echo '<li class="mashsb-tabs" id="' . esc_attr($sanitizedID) . '-nav"><a href="#' . esc_attr($sanitizedID) . '">' . wp_kses_post($field['title']) . '</a></li>';
|
||||
}
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Print out the settings fields for a particular settings section
|
||||
*
|
||||
* Part of the Settings API. Use this in a settings page to output
|
||||
* a specific section. Should normally be called by do_settings_sections()
|
||||
* rather than directly.
|
||||
*
|
||||
* @global $wp_settings_fields Storage array of settings fields and their pages/sections
|
||||
* @return string
|
||||
*
|
||||
* @since 2.1.2
|
||||
*
|
||||
* @param string $page Slug title of the admin page who's settings fields you want to show.
|
||||
* @param section $section Slug title of the settings section who's fields you want to show.
|
||||
*
|
||||
* Copied from WP Core 4.0 /wp-admin/includes/template.php do_settings_fields()
|
||||
* We use our own function to be able to create jQuery tabs with easytabs()
|
||||
*
|
||||
* We dont use tables here any longer. Are we stuck in the nineties?
|
||||
* @todo Use sprintf to sanitize $field['id'] instead using str_replace() Should be faster?
|
||||
* @todo some media queries for better responisbility
|
||||
*/
|
||||
function mashsb_do_settings_fields( $page, $section ) {
|
||||
global $wp_settings_fields;
|
||||
$header = false;
|
||||
$firstHeader = false;
|
||||
|
||||
if( !isset( $wp_settings_fields[$page][$section] ) )
|
||||
return;
|
||||
|
||||
// Check first if any callback header registered
|
||||
foreach ( ( array ) $wp_settings_fields[$page][$section] as $field ) {
|
||||
strpos( $field['callback'], 'header' ) !== false ? $header = true : $header = false;
|
||||
|
||||
if( $header === true )
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ( ( array ) $wp_settings_fields[$page][$section] as $field ) {
|
||||
|
||||
$sanitizedID = str_replace( '[', '', $field['id'] );
|
||||
$sanitizedID = str_replace( ']', '', $sanitizedID );
|
||||
|
||||
// Check if header has been created previously
|
||||
if( strpos( $field['callback'], 'header' ) !== false && $firstHeader === false ) {
|
||||
echo '<div id="' . esc_attr($sanitizedID) . '">';
|
||||
echo '<table class="form-table"><tbody>';
|
||||
$firstHeader = true;
|
||||
} elseif( strpos( $field['callback'], 'header' ) !== false && $firstHeader === true ) {
|
||||
// Header has been created previously so we have to close the first opened div
|
||||
echo '</table></div><div id="' . esc_attr($sanitizedID) . '">';
|
||||
echo '<table class="form-table"><tbody>';
|
||||
}
|
||||
if( strpos( $field['callback'], 'header' ) !== false ){
|
||||
// Do not return header_callback Its only needed for creating the navigation entries
|
||||
}
|
||||
// The headline
|
||||
else if( strpos( $field['callback'], 'headline' ) !== false ) {
|
||||
echo '<tr class="row"><th class="row th">';
|
||||
echo '<div class="col-title"><h2>' . esc_html($field['title']) . '</h2></div>';
|
||||
echo '</th>';
|
||||
echo '<td>';
|
||||
call_user_func( $field['callback'], $field['args'] );
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
// The Settings
|
||||
} else {
|
||||
echo '<tr class="row"><th class="row th">';
|
||||
echo '<div class="col-title">' . esc_html($field['title']);
|
||||
// Do not show the helper text when its empty
|
||||
if (!empty($field['args']['desc']) ){
|
||||
echo '<a class="mashsb-helper" href="#"></a>';
|
||||
echo '<div class="mashsb-message">' . wp_kses_post($field['args']['desc']) . '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</th>';
|
||||
echo '<td>';
|
||||
call_user_func( $field['callback'], $field['args'] );
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
if( $header === true ) {
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Options Page
|
||||
*
|
||||
* Renders the options page contents.
|
||||
*
|
||||
* @since 1.0
|
||||
* @global $mashsb_options Array of all the MASHSB Options
|
||||
* @return void
|
||||
*/
|
||||
function mashsb_options_page() {
|
||||
global $mashsb_options;
|
||||
|
||||
$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], mashsb_get_settings_tabs() ) ? $_GET['tab'] : 'general';
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="mashsb_admin">
|
||||
<span class="mashsharelogo"> <?php echo esc_html(__( 'MashShare ', 'mashsb' )); ?></span><span class="mashsb-version"><?php echo esc_html(MASHSB_VERSION); ?></span>
|
||||
<div class="about-text" style="clear:both;">
|
||||
<ul id="mash-social-admin-head">
|
||||
<?php echo mashsb_share_buttons(); ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<h2 class="mashsb nav-tab-wrapper">
|
||||
<?php
|
||||
foreach ( mashsb_get_settings_tabs() as $tab_id => $tab_name ) {
|
||||
|
||||
$tab_url = esc_url( add_query_arg( array(
|
||||
'settings-updated' => false,
|
||||
'tab' => $tab_id
|
||||
) ) );
|
||||
|
||||
$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
|
||||
|
||||
echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . esc_attr($active) . '">';
|
||||
echo esc_html( $tab_name );
|
||||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
<div id="mashsb_container" class="mashsb_container">
|
||||
<?php getTabHeader( 'mashsb_settings_' . esc_attr($active_tab), 'mashsb_settings_' . esc_attr($active_tab) ); ?>
|
||||
<div class="mashsb-panel-container"> <!-- new //-->
|
||||
<form method="post" action="options.php">
|
||||
<?php
|
||||
settings_fields( 'mashsb_settings' );
|
||||
mashsb_do_settings_fields( 'mashsb_settings_' . esc_attr($active_tab), 'mashsb_settings_' . esc_attr($active_tab) );
|
||||
?>
|
||||
|
||||
<?php
|
||||
// do not show save button on add-on page
|
||||
if( $active_tab !== 'addons' )
|
||||
submit_button();
|
||||
?>
|
||||
</form>
|
||||
<div><?php echo mashsb_admin_rate_us(); ?></div>
|
||||
</div> <!-- new //-->
|
||||
</div><!-- #tab_container-->
|
||||
<div class="mashsb-sidebar">
|
||||
<?php
|
||||
if (false === mashsb_hide_addons()){
|
||||
echo MASHSB()->template->get_template('sidebar');
|
||||
}
|
||||
?>
|
||||
</div> <!-- #sidebar-->
|
||||
<?php echo mashsb_get_debug_settings(); ?>
|
||||
</div><!-- .mashsb_admin -->
|
||||
<?php
|
||||
echo ob_get_clean();
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
[08-Nov-2025 01:48:00 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[08-Nov-2025 01:48:01 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[15-Nov-2025 02:56:27 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[15-Nov-2025 02:56:27 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[11-Dec-2025 17:28:02 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[11-Dec-2025 17:28:02 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[22-Feb-2026 02:32:37 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[22-Feb-2026 02:32:41 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[20-May-2026 08:05:07 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[20-May-2026 08:05:07 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[15-Jul-2026 14:36:55 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[15-Jul-2026 14:36:56 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[16-Jul-2026 15:50:42 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[16-Jul-2026 15:50:44 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[21-Aug-2026 12:44:53 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[21-Aug-2026 12:44:53 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[22-Aug-2026 01:28:22 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[22-Aug-2026 01:28:22 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
[24-Aug-2026 19:04:38 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php:49
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/metabox-settings.php on line 49
|
||||
[24-Aug-2026 19:04:38 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/admin/settings/user-profiles.php on line 4
|
||||
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Register the meta boxes
|
||||
* Used by MASHSB_RWMB class
|
||||
*
|
||||
* @package MASHSB
|
||||
*
|
||||
* @3.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check if meta boxes are shown for a specific user role and
|
||||
* Show meta box when a specific user role is not specified
|
||||
*
|
||||
* @global array $mashsb_options
|
||||
* @return bool true when meta boxes should be visible for a specific user role
|
||||
*/
|
||||
function mashsb_show_meta_box(){
|
||||
global $mashsb_options;
|
||||
|
||||
$visibility = !empty( $mashsb_options['user_roles_for_sharing_options']) ? $mashsb_options['user_roles_for_sharing_options'] : false;
|
||||
if($visibility && in_array('disable', $visibility)){
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show meta boxes per default in any case when user roles are not defined
|
||||
if(empty($mashsb_options) || !isset($mashsb_options['user_roles_for_sharing_options'])){
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get user roles and plugin settings
|
||||
$user = wp_get_current_user();
|
||||
|
||||
// Loop through user roles
|
||||
foreach($user->roles as $role) {
|
||||
// Rule exists and it is set
|
||||
if( isset( $mashsb_options["user_roles_for_sharing_options"] ) && in_array( str_replace( ' ', null, strtolower( $role ) ), $mashsb_options["user_roles_for_sharing_options"] ) ) {
|
||||
// Garbage collection
|
||||
unset($user);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
unset ($user);
|
||||
return false;
|
||||
}
|
||||
|
||||
add_filter( 'mashsb_rwmb_meta_boxes', 'mashsb_meta_boxes' );
|
||||
function mashsb_meta_boxes( $meta_boxes ) {
|
||||
global $mashsb_options, $post;
|
||||
$prefix = 'mashsb_';
|
||||
$post_types = isset( $mashsb_options['post_types'] ) ? $mashsb_options['post_types'] : array();
|
||||
foreach ( $post_types as $key => $value ):
|
||||
$post_type[] = $key;
|
||||
endforeach;
|
||||
$post_type[] = 'post';
|
||||
$post_type[] = 'page';
|
||||
|
||||
$twitter_handle = isset( $mashsb_options['mashsharer_hashtag'] ) ? $mashsb_options['mashsharer_hashtag'] : '';
|
||||
|
||||
// Do not show meta boxes
|
||||
if( !mashsb_show_meta_box() ) {
|
||||
return apply_filters( 'mashsb_meta_box_settings', $meta_boxes, 10, 0 );
|
||||
}
|
||||
|
||||
// Setup our meta box using an array
|
||||
$meta_boxes[0] = array(
|
||||
'id' => 'mashsb_meta',
|
||||
'title' => 'MashShare Social Sharing Options',
|
||||
'pages' => $post_type,
|
||||
'context' => 'normal',
|
||||
'priority' => 'high',
|
||||
'fields' => array(
|
||||
// Setup the social media image
|
||||
array(
|
||||
'name' => '<span class="mashicon mashicon-share"></span> ' . __( 'Social Media Image', 'mashsb' ),
|
||||
'desc' => __( 'Optimal size for post shared images on Facebook, Google+ and LinkedIn is 1200px x 630px. Aspect ratio 1.9:1', 'mashsb' ),
|
||||
'id' => $prefix . 'og_image',
|
||||
'type' => 'image_advanced',
|
||||
'clone' => false,
|
||||
'max_file_uploads' => 1,
|
||||
'class' => 'mashsb-og-image'
|
||||
),
|
||||
// Setup the social media title
|
||||
array(
|
||||
'name' => '<span class="mashicon mashicon-share"> </span> ' . __( 'Social Media Title', 'mashsb' ),
|
||||
'desc' => __( 'This title is used by the open graph meta tag og:title and will be used when users share your content on Facebook, LinkedIn, or Google+. Leave this blank to use ', 'mashsb' ) . (mashsb_yoast_active() ? __( 'Yoast Facebook / SEO title', 'mashsb' ) : 'the post title'),
|
||||
'id' => $prefix . 'og_title',
|
||||
'type' => 'textarea',
|
||||
'clone' => false,
|
||||
'class' => 'mashsb-og-title'
|
||||
),
|
||||
// Setup the social media description
|
||||
array(
|
||||
'name' => '<span class="mashicon mashicon-share"></span> ' . __( 'Social Media Description', 'mashsb' ),
|
||||
'desc' => __( 'This description is used by the open graph meta tag og:description and will be used when users share your content on Facebook, LinkedIn, and Google Plus. Leave this blank to use ', 'mashsb' ) . (mashsb_yoast_active() ? __( 'Yoast Facebook open graph description or the post excerpt.', 'mashsb' ) : ' the post excerpt.'),
|
||||
'id' => $prefix . 'og_description',
|
||||
'type' => 'textarea',
|
||||
'clone' => false,
|
||||
'class' => 'mashsb-og-desc'
|
||||
),
|
||||
array(
|
||||
'name' => 'divider',
|
||||
'id' => 'divider',
|
||||
'type' => 'divider'
|
||||
),
|
||||
// Setup the pinterest optimized image
|
||||
array(
|
||||
'name' => '<span class="mashicon mashicon-pinterest"></span> ' . __( 'Pinterest Image', 'mashsb' ) . '<a class="mashsb-helper" href="#"></a><div class="mashsb-message" style="display: none;">'.sprintf(__('Get the <a href="%s" target="_blank" rel="noopener">Network Add-On</a> to make use of the Pinterest Features','mashsb'),'https://www.mashshare.net/pricing/?utm_source=meta_box&utm_medium=core_plugin&utm_campaign=pinterest_helper').'</div>',
|
||||
'desc' => __( 'Pinned images need to be more vertical than horizontal in orientation. Use an aspect ratio of 2:3 to 1:3.5 and a minimum width of 600 pixels. So an image that is 600 pixels wide should be between 900 and 2100 pixels tall.', 'mashsb' ),
|
||||
'id' => $prefix . 'pinterest_image',
|
||||
'type' => 'image_advanced',
|
||||
'clone' => false,
|
||||
'max_file_uploads' => 1,
|
||||
'class' => 'mashsb-pinterest-image'
|
||||
),
|
||||
// Setup the pinterest description
|
||||
array(
|
||||
'name' => '<span class="mashicon mashicon-pinterest"></span> ' . __('Pinterest Description', 'mashsb' ) . '<a class="mashsb-helper" href="#"></a><div class="mashsb-message" style="display: none;">'.sprintf(__('Get the <a href="%s" target="_blank" rel="noopener">Network Add-On</a> to make use of the Pinterest Features','mashsb'),'https://www.mashshare.net/pricing/?utm_source=meta_box&utm_medium=core_plugin&utm_campaign=pinterest_helper').'</div>',
|
||||
'desc' => __( 'Place a customized message that will be used when this post is shared on Pinterest. Leave this blank to use the ', 'mashsb' ) . (mashsb_yoast_active() ? __( 'Yoast SEO title', 'mashsb' ) : __( 'the post title', 'mashsb' )),
|
||||
'id' => $prefix . 'pinterest_description',
|
||||
'type' => 'textarea',
|
||||
'clone' => false,
|
||||
'class' => 'mashsb-pinterest-desc'
|
||||
),
|
||||
// Setup the Custom Tweet box
|
||||
array(
|
||||
'name' => '<span class="mashicon mashicon-twitter"></span> ' . __('Custom Tweet','mashsb'),
|
||||
'desc' => mashsb_twitter_desc(),
|
||||
'id' => $prefix . 'custom_tweet',
|
||||
'type' => 'textarea',
|
||||
'clone' => false,
|
||||
'class' => 'mashsb-custom-tweet'
|
||||
),
|
||||
array(
|
||||
'id' => $prefix . 'position',
|
||||
'name' => __('Share Button Position','mashsb'),
|
||||
'type' => 'select',
|
||||
'placeholder' => __('Use Global Setting','mashsb'),
|
||||
'before' => '<div style="max-width:250px;float:left;">',
|
||||
'after' => '</div>',
|
||||
'options' => array(
|
||||
'disable' => __('Disable Automatic Buttons','mashsb'),
|
||||
'before' => __('Above Content','mashsb'),
|
||||
'after' => __('Below Content','mashsb'),
|
||||
'both' => __('Above & Below Content','mashsb'),
|
||||
)
|
||||
),
|
||||
// Setup the og:type
|
||||
array(
|
||||
'name' => '<span class="mashicon mashicon-share"> </span> ' . __( 'Open Graph Type', 'mashsb' ),
|
||||
'desc' => __( 'This is used by the open graph meta tag og:type. Leave this blank to use the default value "article". ', 'mashsb' ),
|
||||
'id' => $prefix . 'og_type',
|
||||
'type' => 'text',
|
||||
'clone' => false,
|
||||
'class' => 'mashsb-og-type',
|
||||
'before' => '<div style="max-width:250px;float:left;">',
|
||||
'after' => '</div>',
|
||||
),
|
||||
array(
|
||||
'helper'=> '<a class="mashsb-helper" href="#" style="margin-left:-4px;"></a><div class="mashsb-message" style="display: none;">'.__('Validate open graph meta tags on your site. Incorrect data can result in wrong share description, title or images and should be fixed! In the facebook debugger click the link "Fetch new scrape information" to purge the facebook cache.','mashsb').'</div>',
|
||||
'id' => $prefix . 'validate_og',
|
||||
'before' => '<div style="max-width:250px;margin-top:45px;">',
|
||||
'after' => '</div>',
|
||||
'type' => 'validate_og'
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'divider',
|
||||
'id' => 'divider',
|
||||
'type' => 'divider'
|
||||
),
|
||||
array(
|
||||
'id' => $prefix . 'twitter_handle',
|
||||
'type' => 'hidden_data',
|
||||
'std' => $twitter_handle,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
return apply_filters( 'mashsb_meta_box_settings', $meta_boxes, 10, 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Yoast is active
|
||||
*
|
||||
* @return boolean true when yoast is active
|
||||
*/
|
||||
function mashsb_yoast_active() {
|
||||
if( defined( 'WPSEO_VERSION' ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mashsb_twitter_desc() {
|
||||
$str = "";
|
||||
if( mashsb_get_twitter_username() ) {
|
||||
$str .= __( 'Based on your username @', 'mashsb' ) . mashsb_get_twitter_username() . __( ' ,the shortened post url and the current content above', 'mashsb' );
|
||||
} else {
|
||||
$str .= __( 'Based on the shortened post url and the current content above', 'mashsb' );
|
||||
}
|
||||
$str .= __( ' your tweet has a maximum of 140 characters. ', 'mashsb' );
|
||||
if (!mashsb_yoast_active()){
|
||||
$str .= __( 'If this is left blank the post title will be used. ', 'mashsb' );
|
||||
}else{
|
||||
$str .= __( 'If this is left blank the Yoast Twitter Title or post title will be used. ', 'mashsb' );
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
// Queue up our profile field functions
|
||||
add_action( 'show_user_profile', 'mashsb_render_user_profiles' );
|
||||
add_action( 'edit_user_profile', 'mashsb_render_user_profiles' );
|
||||
add_action( 'personal_options_update', 'mashsb_save_user_profiles' );
|
||||
add_action( 'edit_user_profile_update', 'mashsb_save_user_profiles' );
|
||||
|
||||
/**
|
||||
* Render the user profile settings
|
||||
*
|
||||
* @param array $user
|
||||
* @return string html
|
||||
*/
|
||||
function mashsb_render_user_profiles( $user ) {
|
||||
|
||||
$html = '<h3>' . __( 'MashShare Social Media Integration', 'mashsb' ) . '</h3>' .
|
||||
'<table class="form-table">' .
|
||||
'<tr>' .
|
||||
'<th><label for="twitter">' . __( 'Twitter Username', 'mashsb' ) . '</label></th>' .
|
||||
'<td>' .
|
||||
'<input type="text" name="mashsb_twitter_handle" id="mashsb_twitter_handle" value="' . esc_attr( get_the_author_meta( 'mashsb_twitter_handle', $user->ID ) ) . '" class="regular-text" />' .
|
||||
'<br /><span class="description">' . __( 'Your Twitter username (without the @ symbol)', 'mashsb' ) . '</span>' .
|
||||
'</tr>' .
|
||||
'<th><label for="mashsb_fb_author_url">' . __( 'Facebook Author URL', 'mashsb' ) . '</label></th>' .
|
||||
'<td>' .
|
||||
'<input type="text" name="mashsb_fb_author_url" id="mashsb_fb_author_url" value="' . esc_attr( get_the_author_meta( 'mashsb_fb_author_url', $user->ID ) ) . '" class="regular-text" />' .
|
||||
'<br /><span class="description">' . __( 'URL to your Facebok profile.', 'mashsb' ) . '</span>' .
|
||||
'</td>' .
|
||||
'</tr>' .
|
||||
'</table>';
|
||||
|
||||
if( mashsb_show_meta_box() ){
|
||||
echo $html;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save user profile
|
||||
*
|
||||
* @param int $user_id
|
||||
* @return boolean
|
||||
*/
|
||||
function mashsb_save_user_profiles( $user_id ) {
|
||||
|
||||
$userId = intval($user_id);
|
||||
|
||||
if (!$userId){
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !current_user_can( 'edit_user', $user_id ) ){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($_POST['mashsb_twitter_handle'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
update_user_meta( $user_id, 'mashsb_twitter_handle', sanitize_text_field(wp_unslash($_POST['mashsb_twitter_handle'])) );
|
||||
|
||||
if (empty($_POST['mashsb_fb_author_url'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
update_user_meta( $user_id, 'mashsb_fb_author_url', sanitize_text_field(wp_unslash($_POST['mashsb_fb_author_url'])) );
|
||||
}
|
||||
Reference in new issue
Block a user