Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/sharedad...
File: sharing.php
<ul class="services-hidden">
[500] Fix | Delete
<?php foreach ( $enabled['hidden'] as $id => $service ) : ?>
[501] Fix | Delete
<?php $this->output_service( $id, $service, true ); ?>
[502] Fix | Delete
<?php endforeach; ?>
[503] Fix | Delete
<li class="end-fix"></li>
[504] Fix | Delete
</ul>
[505] Fix | Delete
</td>
[506] Fix | Delete
</tr>
[507] Fix | Delete
</table>
[508] Fix | Delete
[509] Fix | Delete
<table id="live-preview">
[510] Fix | Delete
<tr>
[511] Fix | Delete
<td class="description">
[512] Fix | Delete
<h3><?php esc_html_e( 'Live Preview', 'jetpack' ); ?></h3>
[513] Fix | Delete
</td>
[514] Fix | Delete
<td class="services">
[515] Fix | Delete
<h2 <?php echo ( is_countable( $enabled['all'] ) && count( $enabled['all'] ) > 0 ) ? ' style="display: none"' : ''; ?>><?php esc_html_e( 'Sharing is off. Add services above to enable.', 'jetpack' ); ?></h2>
[516] Fix | Delete
<div class="sharedaddy sd-sharing-enabled">
[517] Fix | Delete
<?php if ( is_countable( $enabled['all'] ) && count( $enabled['all'] ) > 0 ) : ?>
[518] Fix | Delete
<h3 class="sd-title"><?php echo esc_html( $global['sharing_label'] ); ?></h3>
[519] Fix | Delete
<?php endif; ?>
[520] Fix | Delete
<div class="sd-content">
[521] Fix | Delete
<ul class="preview">
[522] Fix | Delete
<?php foreach ( $enabled['visible'] as $id => $service ) : ?>
[523] Fix | Delete
<?php $this->output_preview( $service ); ?>
[524] Fix | Delete
<?php endforeach; ?>
[525] Fix | Delete
[526] Fix | Delete
<?php if ( is_countable( $enabled['hidden'] ) && count( $enabled['hidden'] ) > 0 ) : ?>
[527] Fix | Delete
<li class="advanced"><a href="#" class="sharing-anchor sd-button share-more"><span><?php esc_html_e( 'More', 'jetpack' ); ?></span></a></li>
[528] Fix | Delete
<?php endif; ?>
[529] Fix | Delete
</ul>
[530] Fix | Delete
[531] Fix | Delete
<?php if ( is_countable( $enabled['hidden'] ) && count( $enabled['hidden'] ) > 0 ) : ?>
[532] Fix | Delete
<div class="sharing-hidden">
[533] Fix | Delete
<div class="inner" style="display: none; <?php echo count( $enabled['hidden'] ) === 1 ? 'width:150px;' : ''; ?>">
[534] Fix | Delete
<?php if ( count( $enabled['hidden'] ) === 1 ) : ?>
[535] Fix | Delete
<ul style="background-image:none;">
[536] Fix | Delete
<?php else : ?>
[537] Fix | Delete
<ul>
[538] Fix | Delete
<?php endif; ?>
[539] Fix | Delete
[540] Fix | Delete
<?php
[541] Fix | Delete
foreach ( $enabled['hidden'] as $id => $service ) {
[542] Fix | Delete
$this->output_preview( $service );
[543] Fix | Delete
}
[544] Fix | Delete
?>
[545] Fix | Delete
</ul>
[546] Fix | Delete
</div>
[547] Fix | Delete
</div>
[548] Fix | Delete
<?php endif; ?>
[549] Fix | Delete
[550] Fix | Delete
<ul class="archive" style="display:none;">
[551] Fix | Delete
<?php
[552] Fix | Delete
foreach ( $sharer->get_all_services_blog() as $id => $service ) :
[553] Fix | Delete
if ( isset( $enabled['visible'][ $id ] ) ) {
[554] Fix | Delete
$service = $enabled['visible'][ $id ];
[555] Fix | Delete
} elseif ( isset( $enabled['hidden'][ $id ] ) ) {
[556] Fix | Delete
$service = $enabled['hidden'][ $id ];
[557] Fix | Delete
}
[558] Fix | Delete
[559] Fix | Delete
$service->button_style = 'icon-text'; // The archive needs the full text, which is removed in JS later.
[560] Fix | Delete
$service->smart = false;
[561] Fix | Delete
$this->output_preview( $service );
[562] Fix | Delete
endforeach;
[563] Fix | Delete
?>
[564] Fix | Delete
<li class="advanced"><a href="#" class="sharing-anchor sd-button share-more"><span><?php esc_html_e( 'More', 'jetpack' ); ?></span></a></li>
[565] Fix | Delete
</ul>
[566] Fix | Delete
</div>
[567] Fix | Delete
</div>
[568] Fix | Delete
<br class="clearing" />
[569] Fix | Delete
</td>
[570] Fix | Delete
</tr>
[571] Fix | Delete
</table>
[572] Fix | Delete
[573] Fix | Delete
<form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="save-enabled-shares">
[574] Fix | Delete
<input type="hidden" name="action" value="sharing_save_services" />
[575] Fix | Delete
<input type="hidden" name="visible" value="<?php echo esc_attr( implode( ',', array_keys( $enabled['visible'] ) ) ); ?>" />
[576] Fix | Delete
<input type="hidden" name="hidden" value="<?php echo esc_attr( implode( ',', array_keys( $enabled['hidden'] ) ) ); ?>" />
[577] Fix | Delete
<input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'sharing-options' ) ); ?>" />
[578] Fix | Delete
</form>
[579] Fix | Delete
</div>
[580] Fix | Delete
[581] Fix | Delete
<form method="post" action="">
[582] Fix | Delete
<table class="form-table">
[583] Fix | Delete
<tbody>
[584] Fix | Delete
<tr valign="top">
[585] Fix | Delete
<th scope="row"><label><?php esc_html_e( 'Button style', 'jetpack' ); ?></label></th>
[586] Fix | Delete
<td>
[587] Fix | Delete
<select name="button_style" id="button_style">
[588] Fix | Delete
<option<?php echo ( $global['button_style'] === 'icon-text' ) ? ' selected="selected"' : ''; ?> value="icon-text"><?php esc_html_e( 'Icon + text', 'jetpack' ); ?></option>
[589] Fix | Delete
<option<?php echo ( $global['button_style'] === 'icon' ) ? ' selected="selected"' : ''; ?> value="icon"><?php esc_html_e( 'Icon only', 'jetpack' ); ?></option>
[590] Fix | Delete
<option<?php echo ( $global['button_style'] === 'text' ) ? ' selected="selected"' : ''; ?> value="text"><?php esc_html_e( 'Text only', 'jetpack' ); ?></option>
[591] Fix | Delete
<option<?php echo ( $global['button_style'] === 'official' ) ? ' selected="selected"' : ''; ?> value="official"><?php esc_html_e( 'Official buttons', 'jetpack' ); ?></option>
[592] Fix | Delete
</select>
[593] Fix | Delete
</td>
[594] Fix | Delete
</tr>
[595] Fix | Delete
<tr valign="top">
[596] Fix | Delete
<th scope="row"><label><?php esc_html_e( 'Sharing label', 'jetpack' ); ?></label></th>
[597] Fix | Delete
<td>
[598] Fix | Delete
<input type="text" name="sharing_label" value="<?php echo esc_attr( $global['sharing_label'] ); ?>" />
[599] Fix | Delete
</td>
[600] Fix | Delete
</tr>
[601] Fix | Delete
<?php
[602] Fix | Delete
/**
[603] Fix | Delete
* Filters the HTML at the beginning of the "Show button on" row.
[604] Fix | Delete
*
[605] Fix | Delete
* @module sharedaddy
[606] Fix | Delete
*
[607] Fix | Delete
* @since 2.1.0
[608] Fix | Delete
*
[609] Fix | Delete
* @param string $var Opening HTML tag at the beginning of the "Show button on" row.
[610] Fix | Delete
*/
[611] Fix | Delete
echo apply_filters( 'sharing_show_buttons_on_row_start', '<tr valign="top">' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[612] Fix | Delete
?>
[613] Fix | Delete
<th scope="row"><label><?php esc_html_e( 'Show buttons on', 'jetpack' ); ?></label></th>
[614] Fix | Delete
<td>
[615] Fix | Delete
<?php
[616] Fix | Delete
$br = false;
[617] Fix | Delete
foreach ( $shows as $show ) :
[618] Fix | Delete
if ( 'index' === $show ) {
[619] Fix | Delete
$label = __( 'Front Page, Archive Pages, and Search Results', 'jetpack' );
[620] Fix | Delete
} else {
[621] Fix | Delete
$post_type_object = get_post_type_object( $show );
[622] Fix | Delete
$label = $post_type_object->labels->name;
[623] Fix | Delete
}
[624] Fix | Delete
?>
[625] Fix | Delete
<?php
[626] Fix | Delete
if ( $br ) {
[627] Fix | Delete
echo '<br />';
[628] Fix | Delete
}
[629] Fix | Delete
?>
[630] Fix | Delete
<label><input type="checkbox"<?php checked( in_array( $show, $global['show'], true ) ); ?> name="show[]" value="<?php echo esc_attr( $show ); ?>" /> <?php echo esc_html( $label ); ?></label>
[631] Fix | Delete
<?php
[632] Fix | Delete
$br = true;
[633] Fix | Delete
endforeach;
[634] Fix | Delete
?>
[635] Fix | Delete
</td>
[636] Fix | Delete
<?php
[637] Fix | Delete
/**
[638] Fix | Delete
* Filters the HTML at the end of the "Show button on" row.
[639] Fix | Delete
*
[640] Fix | Delete
* @module sharedaddy
[641] Fix | Delete
*
[642] Fix | Delete
* @since 2.1.0
[643] Fix | Delete
*
[644] Fix | Delete
* @param string $var Closing HTML tag at the end of the "Show button on" row.
[645] Fix | Delete
*/
[646] Fix | Delete
echo apply_filters( 'sharing_show_buttons_on_row_end', '</tr>' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[647] Fix | Delete
?>
[648] Fix | Delete
[649] Fix | Delete
<?php
[650] Fix | Delete
/**
[651] Fix | Delete
* Fires at the end of the sharing global options settings table.
[652] Fix | Delete
*
[653] Fix | Delete
* @module sharedaddy
[654] Fix | Delete
*
[655] Fix | Delete
* @since 1.1.0
[656] Fix | Delete
*/
[657] Fix | Delete
do_action( 'sharing_global_options' );
[658] Fix | Delete
?>
[659] Fix | Delete
</tbody>
[660] Fix | Delete
</table>
[661] Fix | Delete
[662] Fix | Delete
<p class="submit">
[663] Fix | Delete
<input type="submit" name="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'jetpack' ); ?>" />
[664] Fix | Delete
</p>
[665] Fix | Delete
[666] Fix | Delete
<input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'sharing-options' ) ); ?>" />
[667] Fix | Delete
</form>
[668] Fix | Delete
[669] Fix | Delete
<div id="new-service" style="display: none">
[670] Fix | Delete
<form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="new-service-form">
[671] Fix | Delete
<table class="form-table">
[672] Fix | Delete
<tbody>
[673] Fix | Delete
<tr valign="top">
[674] Fix | Delete
<th scope="row" width="100"><label><?php esc_html_e( 'Service name', 'jetpack' ); ?></label></th>
[675] Fix | Delete
<td>
[676] Fix | Delete
<input type="text" name="sharing_name" id="new_sharing_name" size="40" />
[677] Fix | Delete
</td>
[678] Fix | Delete
</tr>
[679] Fix | Delete
<tr valign="top">
[680] Fix | Delete
<th scope="row" width="100"><label><?php esc_html_e( 'Sharing URL', 'jetpack' ); ?></label></th>
[681] Fix | Delete
<td>
[682] Fix | Delete
<input type="text" name="sharing_url" id="new_sharing_url" size="40" />
[683] Fix | Delete
[684] Fix | Delete
<p><?php esc_html_e( 'You can add the following variables to your service sharing URL:', 'jetpack' ); ?><br/>
[685] Fix | Delete
<code>%post_id%</code>, <code>%post_title%</code>, <code>%post_slug%</code>, <code>%post_url%</code>, <code>%post_full_url%</code>, <code>%post_excerpt%</code>, <code>%post_tags%</code>, <code>%home_url%</code></p>
[686] Fix | Delete
</td>
[687] Fix | Delete
</tr>
[688] Fix | Delete
<tr valign="top">
[689] Fix | Delete
<th scope="row" width="100"><label><?php esc_html_e( 'Icon URL', 'jetpack' ); ?></label></th>
[690] Fix | Delete
<td>
[691] Fix | Delete
<input type="text" name="sharing_icon" id="new_sharing_icon" size="40" />
[692] Fix | Delete
<p><?php esc_html_e( 'Enter the URL of a 16x16px icon you want to use for this service.', 'jetpack' ); ?></p>
[693] Fix | Delete
</td>
[694] Fix | Delete
</tr>
[695] Fix | Delete
<tr valign="top" width="100">
[696] Fix | Delete
<th scope="row"></th>
[697] Fix | Delete
<td>
[698] Fix | Delete
<input type="submit" class="button-primary" value="<?php esc_attr_e( 'Create Share Button', 'jetpack' ); ?>" />
[699] Fix | Delete
<img src="<?php echo esc_url( admin_url( 'images/loading.gif' ) ); ?>" width="16" height="16" alt="loading" style="vertical-align: middle; display: none" />
[700] Fix | Delete
</td>
[701] Fix | Delete
</tr>
[702] Fix | Delete
[703] Fix | Delete
<?php
[704] Fix | Delete
/**
[705] Fix | Delete
* Fires after the custom sharing service form
[706] Fix | Delete
*
[707] Fix | Delete
* @module sharedaddy
[708] Fix | Delete
*
[709] Fix | Delete
* @since 1.1.0
[710] Fix | Delete
*/
[711] Fix | Delete
do_action( 'sharing_new_service_form' );
[712] Fix | Delete
?>
[713] Fix | Delete
</tbody>
[714] Fix | Delete
</table>
[715] Fix | Delete
[716] Fix | Delete
<?php
[717] Fix | Delete
/**
[718] Fix | Delete
* Fires at the bottom of the admin sharing settings screen.
[719] Fix | Delete
*
[720] Fix | Delete
* @module sharedaddy
[721] Fix | Delete
*
[722] Fix | Delete
* @since 1.6.0
[723] Fix | Delete
*/
[724] Fix | Delete
do_action( 'post_admin_screen_sharing' );
[725] Fix | Delete
?>
[726] Fix | Delete
[727] Fix | Delete
<div class="inerror" style="display: none; margin-top: 15px">
[728] Fix | Delete
<p><?php esc_html_e( 'An error occurred creating your new sharing service - please check you gave valid details.', 'jetpack' ); ?></p>
[729] Fix | Delete
</div>
[730] Fix | Delete
[731] Fix | Delete
<input type="hidden" name="action" value="sharing_new_service" />
[732] Fix | Delete
<input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'sharing-new_service' ) ); ?>" />
[733] Fix | Delete
</form>
[734] Fix | Delete
</div>
[735] Fix | Delete
<?php
[736] Fix | Delete
}
[737] Fix | Delete
[738] Fix | Delete
/**
[739] Fix | Delete
* Display sharing block admin UI for settings.
[740] Fix | Delete
*
[741] Fix | Delete
* @return void
[742] Fix | Delete
*/
[743] Fix | Delete
public function sharing_block_display() {
[744] Fix | Delete
$showcase_services = array(
[745] Fix | Delete
new Share_Tumblr( 'tumblr', array() ),
[746] Fix | Delete
new Share_Facebook( 'facebook', array() ),
[747] Fix | Delete
new Share_Email( 'email', array() ),
[748] Fix | Delete
new Share_Reddit( 'reddit', array() ),
[749] Fix | Delete
);
[750] Fix | Delete
[751] Fix | Delete
global $submenu;
[752] Fix | Delete
// Hide the link to Jetpack Sharing settings if no Jetpack Settings found in submenu list
[753] Fix | Delete
$show_jetpack_admin_settings_link = array_reduce(
[754] Fix | Delete
$submenu['jetpack'],
[755] Fix | Delete
function ( $carry, $item ) {
[756] Fix | Delete
return $carry || ( isset( $item[2] ) && $item[2] === 'jetpack#/settings' );
[757] Fix | Delete
},
[758] Fix | Delete
false
[759] Fix | Delete
);
[760] Fix | Delete
?>
[761] Fix | Delete
[762] Fix | Delete
<div class="share_manage_options">
[763] Fix | Delete
<br class="clearing" />
[764] Fix | Delete
<h2><?php esc_html_e( 'Sharing Buttons', 'jetpack' ); ?></h2>
[765] Fix | Delete
<div class="sharing-block-message__items-wrapper">
[766] Fix | Delete
<div>
[767] Fix | Delete
<p><?php esc_html_e( 'Add sharing buttons to your blog and allow your visitors to share posts with their friends.', 'jetpack' ); ?></p>
[768] Fix | Delete
<?php $this->site_editor_prompt_display(); ?>
[769] Fix | Delete
</div>
[770] Fix | Delete
<div>
[771] Fix | Delete
<p><?php esc_html_e( 'Sharing Buttons example:', 'jetpack' ); ?></p>
[772] Fix | Delete
<div class="sharedaddy sd-sharing-enabled">
[773] Fix | Delete
<div class="sd-content">
[774] Fix | Delete
<ul class="preview">
[775] Fix | Delete
<?php foreach ( $showcase_services as $service ) : ?>
[776] Fix | Delete
<?php $this->output_preview( $service ); ?>
[777] Fix | Delete
<?php endforeach; ?>
[778] Fix | Delete
</ul>
[779] Fix | Delete
</div>
[780] Fix | Delete
</div>
[781] Fix | Delete
</div>
[782] Fix | Delete
<?php if ( $show_jetpack_admin_settings_link ) : ?>
[783] Fix | Delete
<p class="settings-sharing__block-theme-description">
[784] Fix | Delete
<?php
[785] Fix | Delete
printf(
[786] Fix | Delete
wp_kses(
[787] Fix | Delete
/* translators: Link to Jetpack sharing settings. */
[788] Fix | Delete
__( 'You are using a block-based theme. You can <a class="dops-card__link" href="%s">disable Jetpack’s legacy sharing buttons</a> and add a sharing block to your theme’s template instead.', 'jetpack' ),
[789] Fix | Delete
array(
[790] Fix | Delete
'a' => array( 'href' => array() ),
[791] Fix | Delete
)
[792] Fix | Delete
),
[793] Fix | Delete
esc_url( admin_url( 'admin.php?page=jetpack#/sharing' ) )
[794] Fix | Delete
);
[795] Fix | Delete
?>
[796] Fix | Delete
</p>
[797] Fix | Delete
<?php endif; ?>
[798] Fix | Delete
</div>
[799] Fix | Delete
<br class="clearing" />
[800] Fix | Delete
</div>
[801] Fix | Delete
<?php
[802] Fix | Delete
}
[803] Fix | Delete
[804] Fix | Delete
/**
[805] Fix | Delete
* Display the "Go to the site editor" prompt.
[806] Fix | Delete
*
[807] Fix | Delete
* @return void
[808] Fix | Delete
*/
[809] Fix | Delete
public function site_editor_prompt_display() {
[810] Fix | Delete
$host = new Status\Host();
[811] Fix | Delete
[812] Fix | Delete
$wpcom_link = 'https://wordpress.com/support/wordpress-editor/blocks/sharing-buttons-block/';
[813] Fix | Delete
[814] Fix | Delete
if ( function_exists( 'localized_wpcom_url' ) ) {
[815] Fix | Delete
$wpcom_link = localized_wpcom_url( $wpcom_link );
[816] Fix | Delete
}
[817] Fix | Delete
[818] Fix | Delete
$link = $host->is_wpcom_platform() ? $wpcom_link : Redirect::get_url( 'jetpack-support-sharing-block' );
[819] Fix | Delete
[820] Fix | Delete
?>
[821] Fix | Delete
<div class="sharing-block-message__buttons-wrapper">
[822] Fix | Delete
<a href="<?php echo esc_url( admin_url( 'site-editor.php?path=%2Fwp_template' ) ); ?>" class="button button-primary">
[823] Fix | Delete
<?php esc_html_e( 'Go to the site editor', 'jetpack' ); ?>
[824] Fix | Delete
</a>
[825] Fix | Delete
<a data-target="wpcom-help-center" href="<?php echo esc_url( $link ); ?>" class="button" target="_blank" rel="noopener noreferrer">
[826] Fix | Delete
<?php esc_html_e( 'Learn how to add Sharing Buttons', 'jetpack' ); ?>
[827] Fix | Delete
</a>
[828] Fix | Delete
</div>
[829] Fix | Delete
<?php
[830] Fix | Delete
}
[831] Fix | Delete
}
[832] Fix | Delete
[833] Fix | Delete
/**
[834] Fix | Delete
* Callback to get the value for the jetpack_sharing_enabled field.
[835] Fix | Delete
*
[836] Fix | Delete
* When the sharing_disabled post_meta is unset, we follow the global setting in Sharing.
[837] Fix | Delete
* When it is set to 1, we disable sharing on the post, regardless of the global setting.
[838] Fix | Delete
* It is not possible to enable sharing on a post if it is disabled globally.
[839] Fix | Delete
*
[840] Fix | Delete
* @param array $post The post object.
[841] Fix | Delete
*
[842] Fix | Delete
* @return bool
[843] Fix | Delete
*/
[844] Fix | Delete
function jetpack_post_sharing_get_value( array $post ) {
[845] Fix | Delete
if ( ! isset( $post['id'] ) ) {
[846] Fix | Delete
return false;
[847] Fix | Delete
}
[848] Fix | Delete
[849] Fix | Delete
// if sharing IS disabled on this post, enabled=false, so negate the meta
[850] Fix | Delete
return ! get_post_meta( $post['id'], 'sharing_disabled', true );
[851] Fix | Delete
}
[852] Fix | Delete
[853] Fix | Delete
/**
[854] Fix | Delete
* Callback to set sharing_disabled post_meta when the
[855] Fix | Delete
* jetpack_sharing_enabled field is updated.
[856] Fix | Delete
*
[857] Fix | Delete
* When the sharing_disabled post_meta is unset, we follow the global setting in Sharing.
[858] Fix | Delete
* When it is set to 1, we disable sharing on the post, regardless of the global setting.
[859] Fix | Delete
* It is not possible to enable sharing on a post if it is disabled globally.
[860] Fix | Delete
*
[861] Fix | Delete
* @param bool $enable_sharing Should sharing be enabled on this post.
[862] Fix | Delete
* @param WP_Post $post_object The post object.
[863] Fix | Delete
*
[864] Fix | Delete
* @return int|bool
[865] Fix | Delete
*/
[866] Fix | Delete
function jetpack_post_sharing_update_value( $enable_sharing, $post_object ) {
[867] Fix | Delete
if ( $enable_sharing ) {
[868] Fix | Delete
// delete the override if we want to enable sharing
[869] Fix | Delete
return delete_post_meta( $post_object->ID, 'sharing_disabled' );
[870] Fix | Delete
} else {
[871] Fix | Delete
return update_post_meta( $post_object->ID, 'sharing_disabled', true );
[872] Fix | Delete
}
[873] Fix | Delete
}
[874] Fix | Delete
[875] Fix | Delete
/**
[876] Fix | Delete
* Add Sharing post_meta to the REST API Post response.
[877] Fix | Delete
*
[878] Fix | Delete
* @action rest_api_init
[879] Fix | Delete
* @uses register_rest_field
[880] Fix | Delete
* @link https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/
[881] Fix | Delete
*/
[882] Fix | Delete
function jetpack_post_sharing_register_rest_field() {
[883] Fix | Delete
$post_types = get_post_types( array( 'public' => true ) );
[884] Fix | Delete
foreach ( $post_types as $post_type ) {
[885] Fix | Delete
register_rest_field(
[886] Fix | Delete
$post_type,
[887] Fix | Delete
'jetpack_sharing_enabled',
[888] Fix | Delete
array(
[889] Fix | Delete
'get_callback' => 'jetpack_post_sharing_get_value',
[890] Fix | Delete
'update_callback' => 'jetpack_post_sharing_update_value',
[891] Fix | Delete
'schema' => array(
[892] Fix | Delete
'description' => __( 'Are sharing buttons enabled?', 'jetpack' ),
[893] Fix | Delete
'type' => 'boolean',
[894] Fix | Delete
),
[895] Fix | Delete
)
[896] Fix | Delete
);
[897] Fix | Delete
[898] Fix | Delete
/**
[899] Fix | Delete
* Ensures all public internal post-types support `sharing`
[900] Fix | Delete
* This feature support flag is used by the REST API and Gutenberg.
[901] Fix | Delete
*/
[902] Fix | Delete
add_post_type_support( $post_type, 'jetpack-sharing-buttons' );
[903] Fix | Delete
}
[904] Fix | Delete
}
[905] Fix | Delete
[906] Fix | Delete
// Add Sharing post_meta to the REST API Post response.
[907] Fix | Delete
add_action( 'rest_api_init', 'jetpack_post_sharing_register_rest_field' );
[908] Fix | Delete
[909] Fix | Delete
// Some CPTs (e.g. Jetpack portfolios and testimonials) get registered with
[910] Fix | Delete
// restapi_theme_init because they depend on theme support, so let's also hook to that
[911] Fix | Delete
add_action( 'restapi_theme_init', 'jetpack_post_likes_register_rest_field', 20 );
[912] Fix | Delete
[913] Fix | Delete
/**
[914] Fix | Delete
* Initialize sharing settings in WP Admin.
[915] Fix | Delete
*
[916] Fix | Delete
* @return void
[917] Fix | Delete
*/
[918] Fix | Delete
function sharing_admin_init() {
[919] Fix | Delete
global $sharing_admin;
[920] Fix | Delete
[921] Fix | Delete
$sharing_admin = new Sharing_Admin();
[922] Fix | Delete
}
[923] Fix | Delete
[924] Fix | Delete
add_action( 'init', 'sharing_admin_init' );
[925] Fix | Delete
[926] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function