Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/theme-to...
File: social-links.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
[0] Fix | Delete
/**
[1] Fix | Delete
* Theme Tools: Social Links.
[2] Fix | Delete
*
[3] Fix | Delete
* This feature will only be activated for themes that declare their support.
[4] Fix | Delete
* This can be done by adding code similar to the following during the
[5] Fix | Delete
* 'after_setup_theme' action:
[6] Fix | Delete
*
[7] Fix | Delete
* add_theme_support( 'social-links', array(
[8] Fix | Delete
* 'facebook', 'twitter', 'linkedin', 'tumblr',
[9] Fix | Delete
* ) );
[10] Fix | Delete
*
[11] Fix | Delete
* @package automattic/jetpack
[12] Fix | Delete
*/
[13] Fix | Delete
[14] Fix | Delete
use Automattic\Jetpack\Status\Host;
[15] Fix | Delete
[16] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[17] Fix | Delete
exit( 0 );
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
[21] Fix | Delete
[22] Fix | Delete
if ( ! function_exists( 'jetpack_theme_supports_social_links' ) ) {
[23] Fix | Delete
/**
[24] Fix | Delete
* Init Social_Links if the theme declares support.
[25] Fix | Delete
*/
[26] Fix | Delete
function jetpack_theme_supports_social_links() {
[27] Fix | Delete
new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links();
[28] Fix | Delete
}
[29] Fix | Delete
if ( ! ( new Host() )->is_wpcom_platform() ) {
[30] Fix | Delete
add_action( 'init', 'jetpack_theme_supports_social_links', 30 );
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
if ( ! class_exists( 'Social_Links' ) ) {
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Social_Links main class.
[38] Fix | Delete
*
[39] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[40] Fix | Delete
*/
[41] Fix | Delete
class Social_Links {
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Constructor.
[45] Fix | Delete
*
[46] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[47] Fix | Delete
*/
[48] Fix | Delete
public function __construct() {
[49] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->__construct' );
[50] Fix | Delete
new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links();
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* Init the admin setup.
[55] Fix | Delete
*
[56] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[57] Fix | Delete
*/
[58] Fix | Delete
public function admin_setup() {
[59] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->admin_setup' );
[60] Fix | Delete
$social_links_instance = new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links();
[61] Fix | Delete
$social_links_instance->admin_setup();
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Compares the currently saved links with the connected services and removes
[66] Fix | Delete
* links from services that are no longer connected.
[67] Fix | Delete
*
[68] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[69] Fix | Delete
* @return void
[70] Fix | Delete
*/
[71] Fix | Delete
public function check_links() {
[72] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->check_links' );
[73] Fix | Delete
$social_links_instance = new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links();
[74] Fix | Delete
$social_links_instance->check_links();
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Add social link dropdown to the Customizer.
[79] Fix | Delete
*
[80] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[81] Fix | Delete
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
[82] Fix | Delete
*/
[83] Fix | Delete
public function customize_register( $wp_customize ) {
[84] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->customize_register' );
[85] Fix | Delete
$social_links_instance = new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links();
[86] Fix | Delete
$social_links_instance->customize_register( $wp_customize );
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
/**
[90] Fix | Delete
* Sanitizes social links.
[91] Fix | Delete
*
[92] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[93] Fix | Delete
* @param array $option The incoming values to be sanitized.
[94] Fix | Delete
* @return array
[95] Fix | Delete
*/
[96] Fix | Delete
public function sanitize_link( $option ) {
[97] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->sanitize_link' );
[98] Fix | Delete
return ( new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links() )->sanitize_link( $option );
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
/**
[102] Fix | Delete
* Returns whether there are any social links set.
[103] Fix | Delete
*
[104] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[105] Fix | Delete
* @return bool
[106] Fix | Delete
*/
[107] Fix | Delete
public function has_social_links() {
[108] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->has_social_links' );
[109] Fix | Delete
return ( new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links() )->has_social_links(); }
[110] Fix | Delete
[111] Fix | Delete
/**
[112] Fix | Delete
* Return available social links.
[113] Fix | Delete
*
[114] Fix | Delete
* @return array
[115] Fix | Delete
*/
[116] Fix | Delete
public function get_social_links() {
[117] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->get_social_links' );
[118] Fix | Delete
return ( new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links() )->get_social_links();
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
/**
[122] Fix | Delete
* Short-circuits get_option and get_theme_mod calls.
[123] Fix | Delete
*
[124] Fix | Delete
* @deprecated 13.8 Moved to Classic Theme Helper package.
[125] Fix | Delete
* @param string $link The incoming value to be replaced.
[126] Fix | Delete
* @return string $link The social link that we've got.
[127] Fix | Delete
*/
[128] Fix | Delete
public function get_social_link_filter( $link ) {
[129] Fix | Delete
_deprecated_function( __METHOD__, '13.8', 'Automattic\\Jetpack\\Classic_Theme_Helper\\Social_Links->get_social_link_filter' );
[130] Fix | Delete
return ( new \Automattic\Jetpack\Classic_Theme_Helper\Social_Links() )->get_social_link_filter( $link );
[131] Fix | Delete
}
[132] Fix | Delete
}
[133] Fix | Delete
[134] Fix | Delete
} // - end if ( ! class_exists( 'Social_Links' )
[135] Fix | Delete
[136] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function