Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../src/integrat.../third-pa...
File: elementor.php
protected function render_hidden_fields() {
[500] Fix | Delete
// Wrap in a form with an action and post_id for the submit.
[501] Fix | Delete
\printf(
[502] Fix | Delete
'<form id="yoast-form" method="post" action="%1$s"><input type="hidden" name="action" value="wpseo_elementor_save" /><input type="hidden" id="post_ID" name="post_id" value="%2$s" />',
[503] Fix | Delete
\esc_url( \admin_url( 'admin-ajax.php' ) ),
[504] Fix | Delete
\esc_attr( $this->get_metabox_post()->ID )
[505] Fix | Delete
);
[506] Fix | Delete
[507] Fix | Delete
\wp_nonce_field( 'wpseo_elementor_save', '_wpseo_elementor_nonce' );
[508] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Meta_Fields_Presenter->present is considered safe.
[509] Fix | Delete
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'general' );
[510] Fix | Delete
[511] Fix | Delete
if ( $this->is_advanced_metadata_enabled ) {
[512] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Meta_Fields_Presenter->present is considered safe.
[513] Fix | Delete
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'advanced' );
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Meta_Fields_Presenter->present is considered safe.
[517] Fix | Delete
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'schema', $this->get_metabox_post()->post_type );
[518] Fix | Delete
[519] Fix | Delete
if ( $this->social_is_enabled ) {
[520] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Meta_Fields_Presenter->present is considered safe.
[521] Fix | Delete
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'social' );
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
\printf(
[525] Fix | Delete
'<input type="hidden" id="%1$s" name="%1$s" value="%2$s" />',
[526] Fix | Delete
\esc_attr( WPSEO_Meta::$form_prefix . 'slug' ),
[527] Fix | Delete
\esc_attr( $this->get_post_slug() )
[528] Fix | Delete
);
[529] Fix | Delete
[530] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output should be escaped in the filter.
[531] Fix | Delete
echo \apply_filters( 'wpseo_elementor_hidden_fields', '' );
[532] Fix | Delete
[533] Fix | Delete
echo '</form>';
[534] Fix | Delete
}
[535] Fix | Delete
[536] Fix | Delete
/**
[537] Fix | Delete
* Returns the slug for the post being edited.
[538] Fix | Delete
*
[539] Fix | Delete
* @return string
[540] Fix | Delete
*/
[541] Fix | Delete
protected function get_post_slug() {
[542] Fix | Delete
$post = $this->get_metabox_post();
[543] Fix | Delete
[544] Fix | Delete
// In case get_metabox_post returns null for whatever reason.
[545] Fix | Delete
if ( ! $post instanceof WP_Post ) {
[546] Fix | Delete
return '';
[547] Fix | Delete
}
[548] Fix | Delete
[549] Fix | Delete
// Drafts might not have a post_name unless the slug has been manually changed.
[550] Fix | Delete
// In this case we get it using get_sample_permalink.
[551] Fix | Delete
if ( ! $post->post_name ) {
[552] Fix | Delete
$sample = \get_sample_permalink( $post );
[553] Fix | Delete
[554] Fix | Delete
// Since get_sample_permalink runs through filters, ensure that it has the expected return value.
[555] Fix | Delete
if ( \is_array( $sample ) && \count( $sample ) === 2 && \is_string( $sample[1] ) ) {
[556] Fix | Delete
return $sample[1];
[557] Fix | Delete
}
[558] Fix | Delete
}
[559] Fix | Delete
[560] Fix | Delete
return $post->post_name;
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
/**
[564] Fix | Delete
* Returns post in metabox context.
[565] Fix | Delete
*
[566] Fix | Delete
* @return WP_Post|null
[567] Fix | Delete
*/
[568] Fix | Delete
protected function get_metabox_post() {
[569] Fix | Delete
if ( $this->post !== null ) {
[570] Fix | Delete
return $this->post;
[571] Fix | Delete
}
[572] Fix | Delete
[573] Fix | Delete
$post = null;
[574] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
[575] Fix | Delete
if ( isset( $_GET['post'] ) && \is_numeric( $_GET['post'] ) ) {
[576] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.NonceVerification.Recommended -- Reason: No sanitization needed because we cast to an integer,We are not processing form information.
[577] Fix | Delete
$post = (int) \wp_unslash( $_GET['post'] );
[578] Fix | Delete
}
[579] Fix | Delete
[580] Fix | Delete
if ( ! empty( $post ) ) {
[581] Fix | Delete
$this->post = \get_post( $post );
[582] Fix | Delete
[583] Fix | Delete
return $this->post;
[584] Fix | Delete
}
[585] Fix | Delete
[586] Fix | Delete
if ( isset( $GLOBALS['post'] ) ) {
[587] Fix | Delete
$this->post = $GLOBALS['post'];
[588] Fix | Delete
[589] Fix | Delete
return $this->post;
[590] Fix | Delete
}
[591] Fix | Delete
[592] Fix | Delete
return null;
[593] Fix | Delete
}
[594] Fix | Delete
[595] Fix | Delete
/**
[596] Fix | Delete
* Passes variables to js for use with the post-scraper.
[597] Fix | Delete
*
[598] Fix | Delete
* @return array
[599] Fix | Delete
*/
[600] Fix | Delete
protected function get_metabox_script_data() {
[601] Fix | Delete
$permalink = '';
[602] Fix | Delete
[603] Fix | Delete
if ( \is_object( $this->get_metabox_post() ) ) {
[604] Fix | Delete
$permalink = \get_sample_permalink( $this->get_metabox_post()->ID );
[605] Fix | Delete
$permalink = $permalink[0];
[606] Fix | Delete
}
[607] Fix | Delete
[608] Fix | Delete
$post_formatter = new WPSEO_Metabox_Formatter(
[609] Fix | Delete
new WPSEO_Post_Metabox_Formatter( $this->get_metabox_post(), [], $permalink )
[610] Fix | Delete
);
[611] Fix | Delete
[612] Fix | Delete
$values = $post_formatter->get_values();
[613] Fix | Delete
[614] Fix | Delete
/** This filter is documented in admin/filters/class-cornerstone-filter.php. */
[615] Fix | Delete
$post_types = \apply_filters( 'wpseo_cornerstone_post_types', \YoastSEO()->helpers->post_type->get_accessible_post_types() );
[616] Fix | Delete
if ( $values['cornerstoneActive'] && ! \in_array( $this->get_metabox_post()->post_type, $post_types, true ) ) {
[617] Fix | Delete
$values['cornerstoneActive'] = false;
[618] Fix | Delete
}
[619] Fix | Delete
[620] Fix | Delete
$values['elementorMarkerStatus'] = $this->is_highlighting_available() ? 'enabled' : 'hidden';
[621] Fix | Delete
[622] Fix | Delete
return $values;
[623] Fix | Delete
}
[624] Fix | Delete
[625] Fix | Delete
/**
[626] Fix | Delete
* Checks whether the highlighting functionality is available for Elementor:
[627] Fix | Delete
* - in Free it's always available (as an upsell).
[628] Fix | Delete
* - in Premium it's available as long as the version is 21.8-RC0 or above.
[629] Fix | Delete
*
[630] Fix | Delete
* @return bool Whether the highlighting functionality is available.
[631] Fix | Delete
*/
[632] Fix | Delete
private function is_highlighting_available() {
[633] Fix | Delete
$is_premium = \YoastSEO()->helpers->product->is_premium();
[634] Fix | Delete
$premium_version = \YoastSEO()->helpers->product->get_premium_version();
[635] Fix | Delete
[636] Fix | Delete
return ! $is_premium || \version_compare( $premium_version, '21.8-RC0', '>=' );
[637] Fix | Delete
}
[638] Fix | Delete
[639] Fix | Delete
/**
[640] Fix | Delete
* Prepares the replace vars for localization.
[641] Fix | Delete
*
[642] Fix | Delete
* @return array Replace vars.
[643] Fix | Delete
*/
[644] Fix | Delete
protected function get_replace_vars() {
[645] Fix | Delete
$cached_replacement_vars = [];
[646] Fix | Delete
[647] Fix | Delete
$vars_to_cache = [
[648] Fix | Delete
'date',
[649] Fix | Delete
'id',
[650] Fix | Delete
'sitename',
[651] Fix | Delete
'sitedesc',
[652] Fix | Delete
'sep',
[653] Fix | Delete
'page',
[654] Fix | Delete
'currentyear',
[655] Fix | Delete
'currentdate',
[656] Fix | Delete
'currentmonth',
[657] Fix | Delete
'currentday',
[658] Fix | Delete
'tag',
[659] Fix | Delete
'category',
[660] Fix | Delete
'category_title',
[661] Fix | Delete
'primary_category',
[662] Fix | Delete
'pt_single',
[663] Fix | Delete
'pt_plural',
[664] Fix | Delete
'modified',
[665] Fix | Delete
'name',
[666] Fix | Delete
'user_description',
[667] Fix | Delete
'pagetotal',
[668] Fix | Delete
'pagenumber',
[669] Fix | Delete
'post_year',
[670] Fix | Delete
'post_month',
[671] Fix | Delete
'post_day',
[672] Fix | Delete
'author_first_name',
[673] Fix | Delete
'author_last_name',
[674] Fix | Delete
'permalink',
[675] Fix | Delete
'post_content',
[676] Fix | Delete
];
[677] Fix | Delete
[678] Fix | Delete
foreach ( $vars_to_cache as $var ) {
[679] Fix | Delete
$cached_replacement_vars[ $var ] = \wpseo_replace_vars( '%%' . $var . '%%', $this->get_metabox_post() );
[680] Fix | Delete
}
[681] Fix | Delete
[682] Fix | Delete
// Merge custom replace variables with the WordPress ones.
[683] Fix | Delete
return \array_merge( $cached_replacement_vars, $this->get_custom_replace_vars( $this->get_metabox_post() ) );
[684] Fix | Delete
}
[685] Fix | Delete
[686] Fix | Delete
/**
[687] Fix | Delete
* Prepares the recommended replace vars for localization.
[688] Fix | Delete
*
[689] Fix | Delete
* @return array Recommended replacement variables.
[690] Fix | Delete
*/
[691] Fix | Delete
protected function get_recommended_replace_vars() {
[692] Fix | Delete
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
[693] Fix | Delete
[694] Fix | Delete
// What is recommended depends on the current context.
[695] Fix | Delete
$post_type = $recommended_replace_vars->determine_for_post( $this->get_metabox_post() );
[696] Fix | Delete
[697] Fix | Delete
return $recommended_replace_vars->get_recommended_replacevars_for( $post_type );
[698] Fix | Delete
}
[699] Fix | Delete
[700] Fix | Delete
/**
[701] Fix | Delete
* Returns the list of replace vars that should be hidden inside the editor.
[702] Fix | Delete
*
[703] Fix | Delete
* @return string[] The hidden replace vars.
[704] Fix | Delete
*/
[705] Fix | Delete
protected function get_hidden_replace_vars() {
[706] Fix | Delete
return ( new WPSEO_Replace_Vars() )->get_hidden_replace_vars();
[707] Fix | Delete
}
[708] Fix | Delete
[709] Fix | Delete
/**
[710] Fix | Delete
* Gets the custom replace variables for custom taxonomies and fields.
[711] Fix | Delete
*
[712] Fix | Delete
* @param WP_Post $post The post to check for custom taxonomies and fields.
[713] Fix | Delete
*
[714] Fix | Delete
* @return array Array containing all the replacement variables.
[715] Fix | Delete
*/
[716] Fix | Delete
protected function get_custom_replace_vars( $post ) {
[717] Fix | Delete
return [
[718] Fix | Delete
'custom_fields' => $this->get_custom_fields_replace_vars( $post ),
[719] Fix | Delete
'custom_taxonomies' => $this->get_custom_taxonomies_replace_vars( $post ),
[720] Fix | Delete
];
[721] Fix | Delete
}
[722] Fix | Delete
[723] Fix | Delete
/**
[724] Fix | Delete
* Gets the custom replace variables for custom taxonomies.
[725] Fix | Delete
*
[726] Fix | Delete
* @param WP_Post $post The post to check for custom taxonomies.
[727] Fix | Delete
*
[728] Fix | Delete
* @return array Array containing all the replacement variables.
[729] Fix | Delete
*/
[730] Fix | Delete
protected function get_custom_taxonomies_replace_vars( $post ) {
[731] Fix | Delete
$taxonomies = \get_object_taxonomies( $post, 'objects' );
[732] Fix | Delete
$custom_replace_vars = [];
[733] Fix | Delete
[734] Fix | Delete
foreach ( $taxonomies as $taxonomy_name => $taxonomy ) {
[735] Fix | Delete
[736] Fix | Delete
if ( \is_string( $taxonomy ) ) { // If attachment, see https://core.trac.wordpress.org/ticket/37368 .
[737] Fix | Delete
$taxonomy_name = $taxonomy;
[738] Fix | Delete
$taxonomy = \get_taxonomy( $taxonomy_name );
[739] Fix | Delete
}
[740] Fix | Delete
[741] Fix | Delete
if ( $taxonomy->_builtin && $taxonomy->public ) {
[742] Fix | Delete
continue;
[743] Fix | Delete
}
[744] Fix | Delete
[745] Fix | Delete
$custom_replace_vars[ $taxonomy_name ] = [
[746] Fix | Delete
'name' => $taxonomy->name,
[747] Fix | Delete
'description' => $taxonomy->description,
[748] Fix | Delete
];
[749] Fix | Delete
}
[750] Fix | Delete
[751] Fix | Delete
return $custom_replace_vars;
[752] Fix | Delete
}
[753] Fix | Delete
[754] Fix | Delete
/**
[755] Fix | Delete
* Gets the custom replace variables for custom fields.
[756] Fix | Delete
*
[757] Fix | Delete
* @param WP_Post $post The post to check for custom fields.
[758] Fix | Delete
*
[759] Fix | Delete
* @return array Array containing all the replacement variables.
[760] Fix | Delete
*/
[761] Fix | Delete
protected function get_custom_fields_replace_vars( $post ) {
[762] Fix | Delete
$custom_replace_vars = [];
[763] Fix | Delete
[764] Fix | Delete
// If no post object is passed, return the empty custom_replace_vars array.
[765] Fix | Delete
if ( ! \is_object( $post ) ) {
[766] Fix | Delete
return $custom_replace_vars;
[767] Fix | Delete
}
[768] Fix | Delete
[769] Fix | Delete
$custom_fields = \get_post_custom( $post->ID );
[770] Fix | Delete
[771] Fix | Delete
// Simply concatenate all fields containing replace vars so we can handle them all with a single regex find.
[772] Fix | Delete
$replace_vars_fields = \implode(
[773] Fix | Delete
' ',
[774] Fix | Delete
[
[775] Fix | Delete
\YoastSEO()->meta->for_post( $post->ID )->presentation->title,
[776] Fix | Delete
\YoastSEO()->meta->for_post( $post->ID )->presentation->meta_description,
[777] Fix | Delete
]
[778] Fix | Delete
);
[779] Fix | Delete
[780] Fix | Delete
\preg_match_all( '/%%cf_([A-Za-z0-9_]+)%%/', $replace_vars_fields, $matches );
[781] Fix | Delete
$fields_to_include = $matches[1];
[782] Fix | Delete
foreach ( $custom_fields as $custom_field_name => $custom_field ) {
[783] Fix | Delete
// Skip private custom fields.
[784] Fix | Delete
if ( \substr( $custom_field_name, 0, 1 ) === '_' ) {
[785] Fix | Delete
continue;
[786] Fix | Delete
}
[787] Fix | Delete
[788] Fix | Delete
// Skip custom fields that are not used, new ones will be fetched dynamically.
[789] Fix | Delete
if ( ! \in_array( $custom_field_name, $fields_to_include, true ) ) {
[790] Fix | Delete
continue;
[791] Fix | Delete
}
[792] Fix | Delete
[793] Fix | Delete
// Skip custom field values that are serialized.
[794] Fix | Delete
if ( \is_serialized( $custom_field[0] ) ) {
[795] Fix | Delete
continue;
[796] Fix | Delete
}
[797] Fix | Delete
[798] Fix | Delete
$custom_replace_vars[ $custom_field_name ] = $custom_field[0];
[799] Fix | Delete
}
[800] Fix | Delete
[801] Fix | Delete
return $custom_replace_vars;
[802] Fix | Delete
}
[803] Fix | Delete
[804] Fix | Delete
/**
[805] Fix | Delete
* Determines the scope based on the post type.
[806] Fix | Delete
* This can be used by the replacevar plugin to determine if a replacement needs to be executed.
[807] Fix | Delete
*
[808] Fix | Delete
* @return string String describing the current scope.
[809] Fix | Delete
*/
[810] Fix | Delete
protected function determine_scope() {
[811] Fix | Delete
if ( $this->get_metabox_post()->post_type === 'page' ) {
[812] Fix | Delete
return 'page';
[813] Fix | Delete
}
[814] Fix | Delete
[815] Fix | Delete
return 'post';
[816] Fix | Delete
}
[817] Fix | Delete
[818] Fix | Delete
/**
[819] Fix | Delete
* Determines whether or not the current post type has registered taxonomies.
[820] Fix | Delete
*
[821] Fix | Delete
* @return bool Whether the current post type has taxonomies.
[822] Fix | Delete
*/
[823] Fix | Delete
protected function current_post_type_has_taxonomies() {
[824] Fix | Delete
$post_taxonomies = \get_object_taxonomies( $this->get_metabox_post()->post_type );
[825] Fix | Delete
[826] Fix | Delete
return ! empty( $post_taxonomies );
[827] Fix | Delete
}
[828] Fix | Delete
[829] Fix | Delete
/**
[830] Fix | Delete
* Returns an array with shortcode tags for all registered shortcodes.
[831] Fix | Delete
*
[832] Fix | Delete
* @return array
[833] Fix | Delete
*/
[834] Fix | Delete
protected function get_valid_shortcode_tags() {
[835] Fix | Delete
$shortcode_tags = [];
[836] Fix | Delete
[837] Fix | Delete
foreach ( $GLOBALS['shortcode_tags'] as $tag => $description ) {
[838] Fix | Delete
$shortcode_tags[] = $tag;
[839] Fix | Delete
}
[840] Fix | Delete
[841] Fix | Delete
return $shortcode_tags;
[842] Fix | Delete
}
[843] Fix | Delete
}
[844] Fix | Delete
[845] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function