Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder/module
File: FullwidthPostTitle.php
'tag' => 'img',
[500] Fix | Delete
'attrs' => $featured_image_attrs,
[501] Fix | Delete
)
[502] Fix | Delete
);
[503] Fix | Delete
[504] Fix | Delete
$featured_image_output = $multi_view->render_element(
[505] Fix | Delete
array(
[506] Fix | Delete
'tag' => 'div',
[507] Fix | Delete
'content' => sprintf( '<div class="et_pb_title_featured_image"><span class="et_pb_image_wrap">%1$s</span></div>', $featured_image_content ),
[508] Fix | Delete
'attrs' => array(
[509] Fix | Delete
'class' => 'et_pb_title_featured_container',
[510] Fix | Delete
),
[511] Fix | Delete
'visibility' => array(
[512] Fix | Delete
'featured_image' => 'on',
[513] Fix | Delete
),
[514] Fix | Delete
'required' => array(
[515] Fix | Delete
'featured_image' => 'on',
[516] Fix | Delete
),
[517] Fix | Delete
)
[518] Fix | Delete
);
[519] Fix | Delete
[520] Fix | Delete
// Image height.
[521] Fix | Delete
$this->generate_styles(
[522] Fix | Delete
array(
[523] Fix | Delete
'hover' => false,
[524] Fix | Delete
'base_attr_name' => 'image_height',
[525] Fix | Delete
'selector' => '%%order_class%% .et_pb_title_featured_container img',
[526] Fix | Delete
'css_property' => 'height',
[527] Fix | Delete
'render_slug' => $render_slug,
[528] Fix | Delete
'type' => 'range',
[529] Fix | Delete
)
[530] Fix | Delete
);
[531] Fix | Delete
[532] Fix | Delete
// Image max height.
[533] Fix | Delete
$this->generate_styles(
[534] Fix | Delete
array(
[535] Fix | Delete
'hover' => false,
[536] Fix | Delete
'base_attr_name' => 'image_max_height',
[537] Fix | Delete
'selector' => '%%order_class%% .et_pb_title_featured_container img',
[538] Fix | Delete
'css_property' => 'max-height',
[539] Fix | Delete
'render_slug' => $render_slug,
[540] Fix | Delete
'type' => 'range',
[541] Fix | Delete
)
[542] Fix | Delete
);
[543] Fix | Delete
[544] Fix | Delete
if ( 'off' === $this->props['force_fullwidth'] ) {
[545] Fix | Delete
// Image width.
[546] Fix | Delete
$this->generate_styles(
[547] Fix | Delete
array(
[548] Fix | Delete
'hover' => false,
[549] Fix | Delete
'base_attr_name' => 'image_width',
[550] Fix | Delete
'selector' => '%%order_class%% .et_pb_title_featured_image',
[551] Fix | Delete
'css_property' => 'width',
[552] Fix | Delete
'render_slug' => $render_slug,
[553] Fix | Delete
'type' => 'range',
[554] Fix | Delete
)
[555] Fix | Delete
);
[556] Fix | Delete
[557] Fix | Delete
// Image max width.
[558] Fix | Delete
$this->generate_styles(
[559] Fix | Delete
array(
[560] Fix | Delete
'hover' => false,
[561] Fix | Delete
'base_attr_name' => 'image_max_width',
[562] Fix | Delete
'selector' => '%%order_class%% .et_pb_title_featured_image',
[563] Fix | Delete
'css_property' => 'max-width',
[564] Fix | Delete
'render_slug' => $render_slug,
[565] Fix | Delete
'type' => 'range',
[566] Fix | Delete
)
[567] Fix | Delete
);
[568] Fix | Delete
[569] Fix | Delete
// Image alignment style
[570] Fix | Delete
$image_alignment_values = et_pb_responsive_options()->get_property_values( $this->props, 'image_alignment', 'none' );
[571] Fix | Delete
[572] Fix | Delete
et_pb_responsive_options()->generate_responsive_css(
[573] Fix | Delete
$image_alignment_values,
[574] Fix | Delete
'%%order_class%% .et_pb_title_featured_image',
[575] Fix | Delete
'text-align',
[576] Fix | Delete
$render_slug,
[577] Fix | Delete
'',
[578] Fix | Delete
'align'
[579] Fix | Delete
);
[580] Fix | Delete
[581] Fix | Delete
$image_alignments = array(
[582] Fix | Delete
'left' => 'auto auto auto 0',
[583] Fix | Delete
'center' => 'auto',
[584] Fix | Delete
'right' => 'auto 0 auto auto',
[585] Fix | Delete
);
[586] Fix | Delete
[587] Fix | Delete
foreach ( $image_alignment_values as $breakpoint => $alignment ) {
[588] Fix | Delete
$image_alignment_values[ $breakpoint ] = et_()->array_get(
[589] Fix | Delete
$image_alignments,
[590] Fix | Delete
$alignment,
[591] Fix | Delete
''
[592] Fix | Delete
);
[593] Fix | Delete
}
[594] Fix | Delete
[595] Fix | Delete
et_pb_responsive_options()->generate_responsive_css(
[596] Fix | Delete
$image_alignment_values,
[597] Fix | Delete
'%%order_class%% .et_pb_title_featured_image',
[598] Fix | Delete
'margin',
[599] Fix | Delete
$render_slug,
[600] Fix | Delete
'',
[601] Fix | Delete
'align'
[602] Fix | Delete
);
[603] Fix | Delete
[604] Fix | Delete
ET_Builder_Element::set_style(
[605] Fix | Delete
$render_slug,
[606] Fix | Delete
array(
[607] Fix | Delete
'selector' => '%%order_class%% .et_pb_image_wrap',
[608] Fix | Delete
'declaration' => 'width: auto;',
[609] Fix | Delete
)
[610] Fix | Delete
);
[611] Fix | Delete
}
[612] Fix | Delete
}
[613] Fix | Delete
[614] Fix | Delete
if ( $multi_view->has_value( 'title', 'on' ) ) {
[615] Fix | Delete
if ( is_et_pb_preview() && isset( $_POST['post_title'] ) && wp_verify_nonce( $_POST['et_pb_preview_nonce'], 'et_pb_preview_nonce' ) ) {
[616] Fix | Delete
$post_title = esc_html( sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) );
[617] Fix | Delete
} else {
[618] Fix | Delete
// Unescaped for backwards compat reasons.
[619] Fix | Delete
$post_title = et_core_intentionally_unescaped( et_builder_get_current_title(), 'html' );
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
$output .= $multi_view->render_element(
[623] Fix | Delete
array(
[624] Fix | Delete
'tag' => et_pb_process_header_level( $header_level, 'h1' ),
[625] Fix | Delete
'content' => $post_title,
[626] Fix | Delete
'attrs' => array(
[627] Fix | Delete
'class' => 'entry-title',
[628] Fix | Delete
),
[629] Fix | Delete
'visibility' => array(
[630] Fix | Delete
'title' => 'on',
[631] Fix | Delete
),
[632] Fix | Delete
)
[633] Fix | Delete
);
[634] Fix | Delete
}
[635] Fix | Delete
[636] Fix | Delete
if ( $post_id && $multi_view->has_value( 'meta', 'on' ) ) {
[637] Fix | Delete
$meta_array = array();
[638] Fix | Delete
[639] Fix | Delete
foreach ( array( 'author', 'date', 'categories', 'comments' ) as $single_meta ) {
[640] Fix | Delete
if ( 'categories' === $single_meta && ! is_singular( 'post' ) ) {
[641] Fix | Delete
continue;
[642] Fix | Delete
}
[643] Fix | Delete
[644] Fix | Delete
$meta_array[] = $multi_view->render_element(
[645] Fix | Delete
array(
[646] Fix | Delete
'content' => et_pb_postinfo_meta( array( $single_meta ), $date_format, esc_html__( '0 comments', 'et_builder' ), esc_html__( '1 comment', 'et_builder' ), '% ' . esc_html__( 'comments', 'et_builder' ) ),
[647] Fix | Delete
'classes' => array(
[648] Fix | Delete
'et_pb_title_meta_item--visible' => array(
[649] Fix | Delete
$single_meta => 'on',
[650] Fix | Delete
'meta' => 'on',
[651] Fix | Delete
),
[652] Fix | Delete
),
[653] Fix | Delete
'visibility' => array(
[654] Fix | Delete
$single_meta => 'on',
[655] Fix | Delete
'meta' => 'on',
[656] Fix | Delete
),
[657] Fix | Delete
'required' => array(
[658] Fix | Delete
$single_meta => 'on',
[659] Fix | Delete
'meta' => 'on',
[660] Fix | Delete
),
[661] Fix | Delete
)
[662] Fix | Delete
);
[663] Fix | Delete
}
[664] Fix | Delete
[665] Fix | Delete
$output .= $multi_view->render_element(
[666] Fix | Delete
array(
[667] Fix | Delete
'tag' => 'p',
[668] Fix | Delete
'content' => implode( '', $meta_array ),
[669] Fix | Delete
'attrs' => array(
[670] Fix | Delete
'class' => 'et_pb_title_meta_container',
[671] Fix | Delete
),
[672] Fix | Delete
'visibility' => array(
[673] Fix | Delete
'meta' => 'on',
[674] Fix | Delete
),
[675] Fix | Delete
)
[676] Fix | Delete
);
[677] Fix | Delete
}
[678] Fix | Delete
[679] Fix | Delete
if ( 'on' === $text_background ) {
[680] Fix | Delete
// Text Background Color.
[681] Fix | Delete
$this->generate_styles(
[682] Fix | Delete
array(
[683] Fix | Delete
'base_attr_name' => 'text_bg_color',
[684] Fix | Delete
'selector' => '%%order_class%% .et_pb_title_container',
[685] Fix | Delete
'css_property' => 'background-color',
[686] Fix | Delete
'render_slug' => $render_slug,
[687] Fix | Delete
'type' => 'color',
[688] Fix | Delete
'additional_css' => 'padding: 1em 1.5em;',
[689] Fix | Delete
)
[690] Fix | Delete
);
[691] Fix | Delete
}
[692] Fix | Delete
[693] Fix | Delete
$video_background = $this->video_background();
[694] Fix | Delete
$background_layout = 'dark' === $text_color ? 'light' : 'dark';
[695] Fix | Delete
$data_background_layout = '';
[696] Fix | Delete
$data_background_layout_hover = '';
[697] Fix | Delete
[698] Fix | Delete
if ( et_pb_hover_options()->is_enabled( 'text_color', $this->props ) && ! empty( $text_color_hover ) && $text_color !== $text_color_hover ) {
[699] Fix | Delete
$data_background_layout = sprintf( ' data-background-layout="%1$s"', esc_attr( $text_color_hover ) );
[700] Fix | Delete
$data_background_layout_hover = sprintf( ' data-background-layout-hover="%1$s"', esc_attr( $text_color ) );
[701] Fix | Delete
}
[702] Fix | Delete
[703] Fix | Delete
// Module classnames
[704] Fix | Delete
$this->add_classname(
[705] Fix | Delete
array(
[706] Fix | Delete
'et_pb_post_title',
[707] Fix | Delete
$this->get_text_orientation_classname(),
[708] Fix | Delete
"et_pb_bg_layout_{$background_layout}",
[709] Fix | Delete
)
[710] Fix | Delete
);
[711] Fix | Delete
[712] Fix | Delete
if ( 'on' === $multi_view->get_value( 'featured_image' ) && 'background' === $featured_placement ) {
[713] Fix | Delete
$this->add_classname( 'et_pb_featured_bg' );
[714] Fix | Delete
}
[715] Fix | Delete
[716] Fix | Delete
if ( 'above' === $featured_placement ) {
[717] Fix | Delete
$this->add_classname( 'et_pb_image_above' );
[718] Fix | Delete
}
[719] Fix | Delete
[720] Fix | Delete
if ( 'below' === $featured_placement ) {
[721] Fix | Delete
$this->add_classname( 'et_pb_image_below' );
[722] Fix | Delete
}
[723] Fix | Delete
[724] Fix | Delete
// Remove automatically added classnames
[725] Fix | Delete
$this->remove_classname(
[726] Fix | Delete
array(
[727] Fix | Delete
'et_pb_fullwidth_post_title',
[728] Fix | Delete
)
[729] Fix | Delete
);
[730] Fix | Delete
[731] Fix | Delete
$muti_view_data_attr = $multi_view->render_attrs(
[732] Fix | Delete
array(
[733] Fix | Delete
'classes' => array(
[734] Fix | Delete
'et_pb_featured_bg' => array(
[735] Fix | Delete
'featured_image' => 'on',
[736] Fix | Delete
'featured_placement' => 'background',
[737] Fix | Delete
),
[738] Fix | Delete
),
[739] Fix | Delete
)
[740] Fix | Delete
);
[741] Fix | Delete
[742] Fix | Delete
$output = sprintf(
[743] Fix | Delete
'<div%3$s class="%2$s" %8$s %9$s %10$s>
[744] Fix | Delete
%4$s
[745] Fix | Delete
%7$s
[746] Fix | Delete
%5$s
[747] Fix | Delete
<div class="et_pb_title_container">
[748] Fix | Delete
%1$s
[749] Fix | Delete
</div>
[750] Fix | Delete
%6$s
[751] Fix | Delete
</div>',
[752] Fix | Delete
$output,
[753] Fix | Delete
$this->module_classname( $render_slug ),
[754] Fix | Delete
$this->module_id(),
[755] Fix | Delete
$parallax_image_background,
[756] Fix | Delete
'on' === $featured_image && 'above' === $featured_placement ? $featured_image_output : '', // #5
[757] Fix | Delete
'on' === $featured_image && 'below' === $featured_placement ? $featured_image_output : '',
[758] Fix | Delete
$video_background,
[759] Fix | Delete
$data_background_layout,
[760] Fix | Delete
$data_background_layout_hover,
[761] Fix | Delete
et_core_esc_previously( $muti_view_data_attr ) // #10
[762] Fix | Delete
);
[763] Fix | Delete
[764] Fix | Delete
return $output;
[765] Fix | Delete
}
[766] Fix | Delete
}
[767] Fix | Delete
[768] Fix | Delete
new ET_Builder_Module_Fullwidth_Post_Title();
[769] Fix | Delete
[770] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function