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