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/clone/wp-conte.../themes/Divi/includes/builder
File: functions.php
</a>
[8500] Fix | Delete
%4$s
[8501] Fix | Delete
</div>
[8502] Fix | Delete
</div>
[8503] Fix | Delete
<div class="et_pb_roles_container_all">
[8504] Fix | Delete
%5$s
[8505] Fix | Delete
</div>
[8506] Fix | Delete
</div>',
[8507] Fix | Delete
et_core_esc_previously( $menu_tabs ),
[8508] Fix | Delete
esc_html__( 'Divi Role Editor', 'et_builder' ),
[8509] Fix | Delete
esc_html__( 'Save Divi Roles', 'et_builder' ),
[8510] Fix | Delete
et_core_esc_previously( et_builder_portability_link( 'et_pb_roles', array( 'class' => 'et-pb-layout-buttons et-pb-portability-button' ) ) ),
[8511] Fix | Delete
et_core_esc_previously( $option_tabs )
[8512] Fix | Delete
);
[8513] Fix | Delete
}
[8514] Fix | Delete
[8515] Fix | Delete
/**
[8516] Fix | Delete
*
[8517] Fix | Delete
* Generates the options tab for specified role.
[8518] Fix | Delete
*
[8519] Fix | Delete
* @return string
[8520] Fix | Delete
*/
[8521] Fix | Delete
function et_pb_generate_roles_tab( $all_role_options, $role ) {
[8522] Fix | Delete
$form_sections = '';
[8523] Fix | Delete
[8524] Fix | Delete
// generate all sections of the form for current role.
[8525] Fix | Delete
if ( ! empty( $all_role_options ) ) {
[8526] Fix | Delete
foreach( $all_role_options as $capability_id => $capability_options ) {
[8527] Fix | Delete
$form_sections .= sprintf(
[8528] Fix | Delete
'<div class="et_pb_roles_section_container">
[8529] Fix | Delete
%1$s
[8530] Fix | Delete
<div class="et_pb_roles_options_internal">
[8531] Fix | Delete
%2$s
[8532] Fix | Delete
</div>
[8533] Fix | Delete
</div>',
[8534] Fix | Delete
! empty( $capability_options['section_title'] )
[8535] Fix | Delete
? sprintf( '<h4 class="et_pb_roles_divider">%1$s <span class="et_pb_toggle_all"></span></h4>', esc_html( $capability_options['section_title'] ) )
[8536] Fix | Delete
: '',
[8537] Fix | Delete
et_pb_generate_capabilities_output( $capability_options['options'], $role )
[8538] Fix | Delete
);
[8539] Fix | Delete
}
[8540] Fix | Delete
}
[8541] Fix | Delete
[8542] Fix | Delete
$output = sprintf(
[8543] Fix | Delete
'<div class="et_pb_roles_options_container et_pb_role-%2$s_options%3$s">
[8544] Fix | Delete
<p class="et_pb_roles_notice">%1$s</p>
[8545] Fix | Delete
<form id="et_pb_%2$s_role" data-role_id="%2$s">
[8546] Fix | Delete
%4$s
[8547] Fix | Delete
</form>
[8548] Fix | Delete
</div>',
[8549] Fix | Delete
esc_html__( 'Using the Divi Role Editor, you can limit the types of actions that can be taken by WordPress users of different roles. This is a great way to limit the functionality available to your customers or guest authors to ensure that they only have the necessary options available to them.', 'et_builder' ),
[8550] Fix | Delete
esc_attr( $role ),
[8551] Fix | Delete
'administrator' === $role ? ' active-container' : '',
[8552] Fix | Delete
$form_sections // #4
[8553] Fix | Delete
);
[8554] Fix | Delete
[8555] Fix | Delete
return $output;
[8556] Fix | Delete
}
[8557] Fix | Delete
[8558] Fix | Delete
/**
[8559] Fix | Delete
*
[8560] Fix | Delete
* Generates the enable/disable buttons list based on provided capabilities array and role
[8561] Fix | Delete
*
[8562] Fix | Delete
* @return string
[8563] Fix | Delete
*/
[8564] Fix | Delete
function et_pb_generate_capabilities_output( $cap_array, $role ) {
[8565] Fix | Delete
$output = '';
[8566] Fix | Delete
[8567] Fix | Delete
if ( ! empty( $cap_array ) ) {
[8568] Fix | Delete
foreach ( $cap_array as $capability => $capability_details ) {
[8569] Fix | Delete
if ( empty( $capability_details['applicability'] ) || ( ! empty( $capability_details['applicability'] ) && in_array( $role, $capability_details['applicability'] ) ) ) {
[8570] Fix | Delete
$output .= sprintf(
[8571] Fix | Delete
'<div class="et_pb_capability_option">
[8572] Fix | Delete
<span class="et_pb_capability_title">%4$s</span>
[8573] Fix | Delete
<div class="et_pb_yes_no_button_wrapper">
[8574] Fix | Delete
<div class="et_pb_yes_no_button et_pb_on_state">
[8575] Fix | Delete
<span class="et_pb_value_text et_pb_on_value">%1$s</span>
[8576] Fix | Delete
<span class="et_pb_button_slider"></span>
[8577] Fix | Delete
<span class="et_pb_value_text et_pb_off_value">%2$s</span>
[8578] Fix | Delete
</div>
[8579] Fix | Delete
<select name="%3$s" id="%3$s" class="et-pb-main-setting regular-text">
[8580] Fix | Delete
<option value="on" %5$s>Yes</option>
[8581] Fix | Delete
<option value="off" %6$s>No</option>
[8582] Fix | Delete
</select>
[8583] Fix | Delete
</div>
[8584] Fix | Delete
</div>',
[8585] Fix | Delete
esc_html__( 'Enabled', 'et_builder' ),
[8586] Fix | Delete
esc_html__( 'Disabled', 'et_builder' ),
[8587] Fix | Delete
esc_attr( $capability ),
[8588] Fix | Delete
esc_html( $capability_details['name'] ),
[8589] Fix | Delete
selected( true, et_pb_is_allowed( $capability, $role ), false ),
[8590] Fix | Delete
selected( false, et_pb_is_allowed( $capability, $role ), false )
[8591] Fix | Delete
);
[8592] Fix | Delete
}
[8593] Fix | Delete
}
[8594] Fix | Delete
}
[8595] Fix | Delete
[8596] Fix | Delete
return $output;
[8597] Fix | Delete
}
[8598] Fix | Delete
[8599] Fix | Delete
/**
[8600] Fix | Delete
*
[8601] Fix | Delete
* Loads scripts and styles for Role Editor Admin page
[8602] Fix | Delete
*
[8603] Fix | Delete
*/
[8604] Fix | Delete
function et_pb_load_roles_admin( $hook ) {
[8605] Fix | Delete
// load scripts only on role editor page
[8606] Fix | Delete
[8607] Fix | Delete
if ( apply_filters( 'et_pb_load_roles_admin_hook', 'divi_page_et_divi_role_editor' ) !== $hook ) {
[8608] Fix | Delete
return;
[8609] Fix | Delete
}
[8610] Fix | Delete
[8611] Fix | Delete
et_core_load_main_fonts();
[8612] Fix | Delete
wp_enqueue_style( 'builder-roles-editor-styles', ET_BUILDER_URI . '/styles/roles_style.css', array( 'et-core-admin' ), ET_BUILDER_VERSION );
[8613] Fix | Delete
wp_enqueue_script( 'builder-roles-editor-scripts', ET_BUILDER_URI . '/scripts/roles_admin.js', array( 'jquery' ), ET_BUILDER_VERSION, true );
[8614] Fix | Delete
wp_localize_script( 'builder-roles-editor-scripts', 'et_pb_roles_options', array(
[8615] Fix | Delete
'ajaxurl' => admin_url( 'admin-ajax.php' ),
[8616] Fix | Delete
'et_roles_nonce' => wp_create_nonce( 'et_roles_nonce' ),
[8617] Fix | Delete
'modal_title' => esc_html__( 'Reset Roles', 'et_builder' ),
[8618] Fix | Delete
'modal_message' => esc_html__( 'All of your current role settings will be set to defaults. Do you wish to proceed?', 'et_builder' ),
[8619] Fix | Delete
'modal_yes' => et_builder_i18n( 'Yes' ),
[8620] Fix | Delete
'modal_no' => et_builder_i18n( 'No' ),
[8621] Fix | Delete
) );
[8622] Fix | Delete
}
[8623] Fix | Delete
add_action( 'admin_enqueue_scripts', 'et_pb_load_roles_admin' );
[8624] Fix | Delete
[8625] Fix | Delete
/**
[8626] Fix | Delete
* Generates the array of allowed modules in jQuery Array format
[8627] Fix | Delete
* @return string
[8628] Fix | Delete
*/
[8629] Fix | Delete
function et_pb_allowed_modules_list( $role = '' ) {
[8630] Fix | Delete
global $typenow;
[8631] Fix | Delete
// always return empty array if user doesn't have the edit_posts capability
[8632] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[8633] Fix | Delete
return "[]";
[8634] Fix | Delete
}
[8635] Fix | Delete
[8636] Fix | Delete
$saved_capabilities = et_pb_get_role_settings();
[8637] Fix | Delete
$role = '' === $role ? et_pb_get_current_user_role() : $role;
[8638] Fix | Delete
[8639] Fix | Delete
$all_modules_array = ET_Builder_Element::get_modules_array( $typenow );
[8640] Fix | Delete
[8641] Fix | Delete
$saved_modules_capabilities = isset( $saved_capabilities[ $role ] ) ? $saved_capabilities[ $role ] : array();
[8642] Fix | Delete
[8643] Fix | Delete
$alowed_modules = "[";
[8644] Fix | Delete
foreach ( $all_modules_array as $module => $module_details ) {
[8645] Fix | Delete
if ( ! in_array( $module_details['label'], array( 'et_pb_section', 'et_pb_row', 'et_pb_row_inner', 'et_pb_column' ) ) ) {
[8646] Fix | Delete
// Add module into the list if it's not saved or if it's saved not with "off" state
[8647] Fix | Delete
if ( ! isset( $saved_modules_capabilities[ $module_details['label'] ] ) || ( isset( $saved_modules_capabilities[ $module_details['label'] ] ) && 'off' !== $saved_modules_capabilities[ $module_details['label'] ] ) ) {
[8648] Fix | Delete
$alowed_modules .= "'" . esc_attr( $module_details['label'] ) . "',";
[8649] Fix | Delete
}
[8650] Fix | Delete
}
[8651] Fix | Delete
}
[8652] Fix | Delete
[8653] Fix | Delete
$alowed_modules .= "]";
[8654] Fix | Delete
[8655] Fix | Delete
return $alowed_modules;
[8656] Fix | Delete
}
[8657] Fix | Delete
[8658] Fix | Delete
if ( ! function_exists( 'et_divi_get_post_text_color' ) ) {
[8659] Fix | Delete
function et_divi_get_post_text_color() {
[8660] Fix | Delete
$text_color_class = '';
[8661] Fix | Delete
[8662] Fix | Delete
$post_format = et_pb_post_format();
[8663] Fix | Delete
[8664] Fix | Delete
if ( in_array( $post_format, array( 'audio', 'link', 'quote' ) ) ) {
[8665] Fix | Delete
$text_color_class = ( $text_color = get_post_meta( get_the_ID(), '_et_post_bg_layout', true ) ) ? $text_color : 'light';
[8666] Fix | Delete
$text_color_class = ' et_pb_text_color_' . $text_color_class;
[8667] Fix | Delete
}
[8668] Fix | Delete
[8669] Fix | Delete
return $text_color_class;
[8670] Fix | Delete
}
[8671] Fix | Delete
}
[8672] Fix | Delete
[8673] Fix | Delete
if ( ! function_exists( 'et_divi_get_post_bg_inline_style' ) ) {
[8674] Fix | Delete
function et_divi_get_post_bg_inline_style() {
[8675] Fix | Delete
$inline_style = '';
[8676] Fix | Delete
[8677] Fix | Delete
$post_id = get_the_ID();
[8678] Fix | Delete
[8679] Fix | Delete
$post_use_bg_color = get_post_meta( $post_id, '_et_post_use_bg_color', true )
[8680] Fix | Delete
? true
[8681] Fix | Delete
: false;
[8682] Fix | Delete
$post_bg_color = ( $bg_color = get_post_meta( $post_id, '_et_post_bg_color', true ) ) && '' !== $bg_color
[8683] Fix | Delete
? $bg_color
[8684] Fix | Delete
: '#ffffff';
[8685] Fix | Delete
[8686] Fix | Delete
if ( $post_use_bg_color ) {
[8687] Fix | Delete
$inline_style = sprintf( ' style="background-color: %1$s;"', esc_html( $post_bg_color ) );
[8688] Fix | Delete
}
[8689] Fix | Delete
[8690] Fix | Delete
return $inline_style;
[8691] Fix | Delete
}
[8692] Fix | Delete
}
[8693] Fix | Delete
[8694] Fix | Delete
function et_remove_blockquote_from_content( $content ) {
[8695] Fix | Delete
if ( 'quote' !== et_pb_post_format() ) {
[8696] Fix | Delete
return $content;
[8697] Fix | Delete
}
[8698] Fix | Delete
[8699] Fix | Delete
if ( et_theme_builder_overrides_layout( ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE ) ) {
[8700] Fix | Delete
// Do not remove quotes when TB has taken over.
[8701] Fix | Delete
return $content;
[8702] Fix | Delete
}
[8703] Fix | Delete
[8704] Fix | Delete
$content = preg_replace( '/<blockquote(.+?)<\/blockquote>/is', '', $content, 1 );
[8705] Fix | Delete
[8706] Fix | Delete
return $content;
[8707] Fix | Delete
}
[8708] Fix | Delete
add_filter( 'the_content', 'et_remove_blockquote_from_content' );
[8709] Fix | Delete
[8710] Fix | Delete
/**
[8711] Fix | Delete
* Register rewrite rule and tag for preview page
[8712] Fix | Delete
* @return void
[8713] Fix | Delete
*/
[8714] Fix | Delete
function et_pb_register_preview_endpoint() {
[8715] Fix | Delete
add_rewrite_tag( '%et_pb_preview%', 'true' );
[8716] Fix | Delete
}
[8717] Fix | Delete
add_action( 'init', 'et_pb_register_preview_endpoint', 11 );
[8718] Fix | Delete
[8719] Fix | Delete
/**
[8720] Fix | Delete
* Flush rewrite rules to fix the issue "preg_match" issue with 2.5
[8721] Fix | Delete
* @return void
[8722] Fix | Delete
*/
[8723] Fix | Delete
function et_pb_maybe_flush_rewrite_rules() {
[8724] Fix | Delete
et_builder_maybe_flush_rewrite_rules( '2_5_flush_rewrite_rules' );
[8725] Fix | Delete
}
[8726] Fix | Delete
add_action( 'init', 'et_pb_maybe_flush_rewrite_rules', 9 );
[8727] Fix | Delete
[8728] Fix | Delete
/**
[8729] Fix | Delete
* Register template for preview page
[8730] Fix | Delete
* @return string path to template file
[8731] Fix | Delete
*/
[8732] Fix | Delete
function et_pb_register_preview_page( $template ) {
[8733] Fix | Delete
global $wp_query;
[8734] Fix | Delete
[8735] Fix | Delete
if ( 'true' === $wp_query->get( 'et_pb_preview' ) && isset( $_GET['et_pb_preview_nonce'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification
[8736] Fix | Delete
show_admin_bar( false );
[8737] Fix | Delete
[8738] Fix | Delete
return ET_BUILDER_DIR . 'template-preview.php';
[8739] Fix | Delete
}
[8740] Fix | Delete
[8741] Fix | Delete
return $template;
[8742] Fix | Delete
}
[8743] Fix | Delete
add_action( 'template_include', 'et_pb_register_preview_page' );
[8744] Fix | Delete
[8745] Fix | Delete
/*
[8746] Fix | Delete
* do_shortcode() replaces square brackers with html entities,
[8747] Fix | Delete
* convert them back to make sure js code works ok
[8748] Fix | Delete
*/
[8749] Fix | Delete
if ( ! function_exists( 'et_builder_replace_code_content_entities' ) ) :
[8750] Fix | Delete
function et_builder_replace_code_content_entities( $content ) {
[8751] Fix | Delete
$content = str_replace( '&#091;', '[', $content );
[8752] Fix | Delete
$content = str_replace( '&#093;', ']', $content );
[8753] Fix | Delete
$content = str_replace( '&#215;', 'x', $content );
[8754] Fix | Delete
[8755] Fix | Delete
return $content;
[8756] Fix | Delete
}
[8757] Fix | Delete
endif;
[8758] Fix | Delete
[8759] Fix | Delete
/*
[8760] Fix | Delete
* we use placeholders to preserve the line-breaks,
[8761] Fix | Delete
* convert them back to \n
[8762] Fix | Delete
*/
[8763] Fix | Delete
if ( ! function_exists( 'et_builder_convert_line_breaks' ) ) :
[8764] Fix | Delete
function et_builder_convert_line_breaks( $content, $line_breaks_format = "\n" ) {
[8765] Fix | Delete
[8766] Fix | Delete
// before we swap out the placeholders,
[8767] Fix | Delete
// remove all the <p> tags and \n that wpautop added!
[8768] Fix | Delete
$content = preg_replace( '/\n/smi', '', $content );
[8769] Fix | Delete
$content = preg_replace( '/<p>/smi', '', $content );
[8770] Fix | Delete
$content = preg_replace( '/<\/p>/smi', '', $content );
[8771] Fix | Delete
[8772] Fix | Delete
$content = str_replace( array( '<!– [et_pb_line_break_holder] –>', '<!-- [et_pb_line_break_holder] -->', '||et_pb_line_break_holder||' ), $line_breaks_format, $content );
[8773] Fix | Delete
$content = str_replace( '<!–- [et_pb_br_holder] -–>', '<br />', $content );
[8774] Fix | Delete
[8775] Fix | Delete
// convert the <pee tags back to <p
[8776] Fix | Delete
// see et_pb_prep_code_module_for_wpautop()
[8777] Fix | Delete
$content = str_replace( '<pee', '<p', $content );
[8778] Fix | Delete
$content = str_replace( '</pee>', '</p> ', $content );
[8779] Fix | Delete
[8780] Fix | Delete
return $content;
[8781] Fix | Delete
}
[8782] Fix | Delete
endif;
[8783] Fix | Delete
[8784] Fix | Delete
// adjust the number of all layouts displayed on library page to exclude predefined layouts
[8785] Fix | Delete
function et_pb_fix_count_library_items( $counts ) {
[8786] Fix | Delete
// do nothing if get_current_screen function doesn't exists at this point to avoid php errors in some plugins.
[8787] Fix | Delete
if ( ! function_exists( 'get_current_screen' ) ) {
[8788] Fix | Delete
return $counts;
[8789] Fix | Delete
}
[8790] Fix | Delete
[8791] Fix | Delete
$current_screen = get_current_screen();
[8792] Fix | Delete
[8793] Fix | Delete
if ( isset( $current_screen->id ) && 'edit-et_pb_layout' === $current_screen->id && isset( $counts->publish ) ) {
[8794] Fix | Delete
// perform query to get all the not predefined layouts
[8795] Fix | Delete
$query = new WP_Query( array(
[8796] Fix | Delete
'meta_query' => array(
[8797] Fix | Delete
array(
[8798] Fix | Delete
'key' => '_et_pb_predefined_layout',
[8799] Fix | Delete
'value' => 'on',
[8800] Fix | Delete
'compare' => 'NOT EXISTS',
[8801] Fix | Delete
),
[8802] Fix | Delete
),
[8803] Fix | Delete
'post_type' => ET_BUILDER_LAYOUT_POST_TYPE,
[8804] Fix | Delete
'posts_per_page' => '-1',
[8805] Fix | Delete
) );
[8806] Fix | Delete
[8807] Fix | Delete
// set the $counts->publish = amount of non predefined layouts
[8808] Fix | Delete
$counts->publish = isset( $query->post_count ) ? (int) $query->post_count : 0;
[8809] Fix | Delete
}
[8810] Fix | Delete
[8811] Fix | Delete
return $counts;
[8812] Fix | Delete
}
[8813] Fix | Delete
add_filter( 'wp_count_posts', 'et_pb_fix_count_library_items' );
[8814] Fix | Delete
[8815] Fix | Delete
function et_pb_generate_mobile_settings_tabs() {
[8816] Fix | Delete
$mobile_settings_tabs = '<%= window.et_builder.mobile_tabs_output() %>';
[8817] Fix | Delete
[8818] Fix | Delete
return $mobile_settings_tabs;
[8819] Fix | Delete
}
[8820] Fix | Delete
[8821] Fix | Delete
/**
[8822] Fix | Delete
* Generates the css code for responsive options.
[8823] Fix | Delete
*
[8824] Fix | Delete
* Uses array of values for each device as input parameter and css_selector with property to
[8825] Fix | Delete
* apply the css
[8826] Fix | Delete
*
[8827] Fix | Delete
* @deprecated See ET_Builder_Module_Helper_ResponsiveOptions::instance()->generate_responsive_css().
[8828] Fix | Delete
*
[8829] Fix | Delete
* @since 3.23 Deprecated.
[8830] Fix | Delete
*
[8831] Fix | Delete
* @param array $values_array All device values.
[8832] Fix | Delete
* @param mixed $css_selector CSS selector.
[8833] Fix | Delete
* @param string $css_property CSS property.
[8834] Fix | Delete
* @param string $function_name Module slug.
[8835] Fix | Delete
* @param string $additional_css Additional CSS.
[8836] Fix | Delete
*/
[8837] Fix | Delete
function et_pb_generate_responsive_css( $values_array, $css_selector, $css_property, $function_name, $additional_css = '' ) {
[8838] Fix | Delete
if ( ! empty( $values_array ) ) {
[8839] Fix | Delete
foreach( $values_array as $device => $current_value ) {
[8840] Fix | Delete
if ( '' === $current_value ) {
[8841] Fix | Delete
continue;
[8842] Fix | Delete
}
[8843] Fix | Delete
$declaration = '';
[8844] Fix | Delete
// value can be provided as a string or array in following format - array( 'property_1' => 'value_1', 'property_2' => 'property_2', ... , 'property_n' => 'value_n' )
[8845] Fix | Delete
if ( is_array( $current_value ) && ! empty( $current_value ) ) {
[8846] Fix | Delete
foreach( $current_value as $this_property => $this_value ) {
[8847] Fix | Delete
if ( '' === $this_value ) {
[8848] Fix | Delete
continue;
[8849] Fix | Delete
}
[8850] Fix | Delete
$declaration .= sprintf(
[8851] Fix | Delete
'%1$s: %2$s%3$s',
[8852] Fix | Delete
$this_property,
[8853] Fix | Delete
esc_html( et_builder_process_range_value( $this_value, $this_property ) ),
[8854] Fix | Delete
'' !== $additional_css ? $additional_css : ';'
[8855] Fix | Delete
);
[8856] Fix | Delete
}
[8857] Fix | Delete
} else {
[8858] Fix | Delete
$declaration = sprintf(
[8859] Fix | Delete
'%1$s: %2$s%3$s',
[8860] Fix | Delete
$css_property,
[8861] Fix | Delete
esc_html( et_builder_process_range_value( $current_value, $css_property ) ),
[8862] Fix | Delete
'' !== $additional_css ? $additional_css : ';'
[8863] Fix | Delete
);
[8864] Fix | Delete
}
[8865] Fix | Delete
if ( '' === $declaration ) {
[8866] Fix | Delete
continue;
[8867] Fix | Delete
}
[8868] Fix | Delete
$style = array(
[8869] Fix | Delete
'selector' => $css_selector,
[8870] Fix | Delete
'declaration' => $declaration,
[8871] Fix | Delete
);
[8872] Fix | Delete
if ( 'desktop_only' === $device ) {
[8873] Fix | Delete
$style['media_query'] = ET_Builder_Element::get_media_query( 'min_width_981' );
[8874] Fix | Delete
} elseif ( 'desktop' !== $device ) {
[8875] Fix | Delete
$current_media_query = 'tablet' === $device ? 'max_width_980' : 'max_width_767';
[8876] Fix | Delete
$style['media_query'] = ET_Builder_Element::get_media_query( $current_media_query );
[8877] Fix | Delete
}
[8878] Fix | Delete
ET_Builder_Element::set_style( $function_name, $style );
[8879] Fix | Delete
}
[8880] Fix | Delete
}
[8881] Fix | Delete
}
[8882] Fix | Delete
[8883] Fix | Delete
function et_pb_custom_search( $query = false ) {
[8884] Fix | Delete
if ( is_admin() || ! is_a( $query, 'WP_Query' ) || ! $query->is_search ) {
[8885] Fix | Delete
return;
[8886] Fix | Delete
}
[8887] Fix | Delete
[8888] Fix | Delete
$utils = ET_Core_Data_Utils::instance();
[8889] Fix | Delete
[8890] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
[8891] Fix | Delete
if ( isset( $_GET['et_pb_searchform_submit'] ) ) {
[8892] Fix | Delete
$postTypes = array();
[8893] Fix | Delete
if ( ! isset($_GET['et_pb_include_posts'] ) && ! isset( $_GET['et_pb_include_pages'] ) ) $postTypes = array( 'post' );
[8894] Fix | Delete
if ( isset( $_GET['et_pb_include_pages'] ) ) $postTypes = array( 'page' );
[8895] Fix | Delete
if ( isset( $_GET['et_pb_include_posts'] ) ) $postTypes[] = 'post';
[8896] Fix | Delete
[8897] Fix | Delete
// $postTypes is allowlisted values only
[8898] Fix | Delete
$query->set( 'post_type', $postTypes );
[8899] Fix | Delete
[8900] Fix | Delete
if ( ! empty( $_GET['et_pb_search_cat'] ) ) {
[8901] Fix | Delete
$categories_array = explode( ',', $_GET['et_pb_search_cat'] );
[8902] Fix | Delete
$categories_array = $utils->sanitize_text_fields( $categories_array );
[8903] Fix | Delete
$query->set( 'category__not_in', $categories_array );
[8904] Fix | Delete
}
[8905] Fix | Delete
[8906] Fix | Delete
if ( isset( $_GET['et-posts-count'] ) ) {
[8907] Fix | Delete
$query->set( 'posts_per_page', (int) $_GET['et-posts-count'] );
[8908] Fix | Delete
}
[8909] Fix | Delete
}
[8910] Fix | Delete
// phpcs:enable
[8911] Fix | Delete
}
[8912] Fix | Delete
add_action( 'pre_get_posts', 'et_pb_custom_search' );
[8913] Fix | Delete
[8914] Fix | Delete
if ( ! function_exists( 'et_custom_comments_display' ) ) :
[8915] Fix | Delete
function et_custom_comments_display( $comment, $args, $depth ) {
[8916] Fix | Delete
$GLOBALS['comment'] = $comment; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
[8917] Fix | Delete
[8918] Fix | Delete
$default_avatar = get_option( 'avatar_default' ) ? get_option( 'avatar_default' ) : 'mystery'; ?>
[8919] Fix | Delete
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
[8920] Fix | Delete
<article id="comment-<?php comment_ID(); ?>" class="comment-body clearfix">
[8921] Fix | Delete
<div class="comment_avatar">
[8922] Fix | Delete
<?php echo get_avatar( $comment, $size = '80', esc_attr( $default_avatar ), esc_attr( get_comment_author() ) ); ?>
[8923] Fix | Delete
</div>
[8924] Fix | Delete
[8925] Fix | Delete
<div class="comment_postinfo">
[8926] Fix | Delete
<?php printf( '<span class="fn">%s</span>', get_comment_author_link() ); ?>
[8927] Fix | Delete
<span class="comment_date">
[8928] Fix | Delete
<?php
[8929] Fix | Delete
/* translators: 1: date, 2: time */
[8930] Fix | Delete
printf( esc_html__( 'on %1$s at %2$s', 'et_builder' ), esc_html( get_comment_date() ), esc_html( get_comment_time() ) );
[8931] Fix | Delete
?>
[8932] Fix | Delete
</span>
[8933] Fix | Delete
<?php edit_comment_link( esc_html__( '(Edit)', 'et_builder' ), ' ' ); ?>
[8934] Fix | Delete
<?php
[8935] Fix | Delete
$et_comment_reply_link = get_comment_reply_link( array_merge( $args, array(
[8936] Fix | Delete
'reply_text' => esc_html__( 'Reply', 'et_builder' ),
[8937] Fix | Delete
'depth' => (int) $depth,
[8938] Fix | Delete
'max_depth' => (int) $args['max_depth'],
[8939] Fix | Delete
) ) );
[8940] Fix | Delete
?>
[8941] Fix | Delete
</div> <!-- .comment_postinfo -->
[8942] Fix | Delete
[8943] Fix | Delete
<div class="comment_area">
[8944] Fix | Delete
<?php if ( '0' === $comment->comment_approved ) : ?>
[8945] Fix | Delete
<em class="moderation"><?php esc_html_e( 'Your comment is awaiting moderation.', 'et_builder' ) ?></em>
[8946] Fix | Delete
<br />
[8947] Fix | Delete
<?php endif; ?>
[8948] Fix | Delete
[8949] Fix | Delete
<div class="comment-content clearfix">
[8950] Fix | Delete
<?php
[8951] Fix | Delete
comment_text();
[8952] Fix | Delete
if ( $et_comment_reply_link ) echo '<span class="reply-container">' . et_core_esc_previously( $et_comment_reply_link ) . '</span>';
[8953] Fix | Delete
?>
[8954] Fix | Delete
</div> <!-- end comment-content-->
[8955] Fix | Delete
</div> <!-- end comment_area-->
[8956] Fix | Delete
</article> <!-- .comment-body -->
[8957] Fix | Delete
<?php }
[8958] Fix | Delete
endif;
[8959] Fix | Delete
[8960] Fix | Delete
/* Exclude library related taxonomies from Yoast SEO Sitemap */
[8961] Fix | Delete
function et_wpseo_sitemap_exclude_taxonomy( $value, $taxonomy ) {
[8962] Fix | Delete
$excluded = array( 'scope', 'module_width', 'layout_type', 'layout_category', 'layout', 'layout_pack' );
[8963] Fix | Delete
[8964] Fix | Delete
if ( in_array( $taxonomy, $excluded ) ) {
[8965] Fix | Delete
return true;
[8966] Fix | Delete
}
[8967] Fix | Delete
[8968] Fix | Delete
return false;
[8969] Fix | Delete
}
[8970] Fix | Delete
add_filter( 'wpseo_sitemap_exclude_taxonomy', 'et_wpseo_sitemap_exclude_taxonomy', 10, 2 );
[8971] Fix | Delete
[8972] Fix | Delete
/**
[8973] Fix | Delete
* Is WP Job Manager plugin active?
[8974] Fix | Delete
*
[8975] Fix | Delete
* @return bool True - if the plugin is active
[8976] Fix | Delete
*/
[8977] Fix | Delete
if ( ! function_exists( 'et_is_wp_job_manager_plugin_active' ) ) :
[8978] Fix | Delete
function et_is_wp_job_manager_plugin_active() {
[8979] Fix | Delete
return class_exists( 'WP_Job_Manager' );
[8980] Fix | Delete
}
[8981] Fix | Delete
endif;
[8982] Fix | Delete
[8983] Fix | Delete
/**
[8984] Fix | Delete
* Is Gutenberg active?
[8985] Fix | Delete
*
[8986] Fix | Delete
* @deprecated See {@see et_core_is_gutenberg_active()}
[8987] Fix | Delete
*
[8988] Fix | Delete
* @since 3.19.2 Renamed and moved to core.
[8989] Fix | Delete
* @since 3.18
[8990] Fix | Delete
*
[8991] Fix | Delete
* @return bool True - if the plugin is active
[8992] Fix | Delete
*/
[8993] Fix | Delete
if ( ! function_exists( 'et_is_gutenberg_active' ) ) :
[8994] Fix | Delete
function et_is_gutenberg_active() {
[8995] Fix | Delete
return et_core_is_gutenberg_active();
[8996] Fix | Delete
}
[8997] Fix | Delete
endif;
[8998] Fix | Delete
[8999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function