ID : $post_id;
}
$content = tve_get_post_meta( $post_id, 'tve_updated_post' );
if ( ! $use_wp_shortcode_check ) {
return strpos( $content, $shortcode ) !== false;
}
if ( $post_id ) {
return has_shortcode( $content, '[' . str_replace( [ '[', ']' ], '', $shortcode ) . ']' );
}
return false;
}
/**
* display any possible conflicts with other plugins / themes as error notification in the admin panel
*/
function tve_admin_notices() {
$has_wp_seo_conflict = tve_has_wordpress_seo_conflict();
if ( $has_wp_seo_conflict ) {
$link = sprintf( '%s', admin_url( 'admin.php?page=wpseo_advanced&tab=permalinks' ), __( 'WordPress SEO settings', 'thrive-cb' ) );
$message
= sprintf( __( 'Thrive Architect and Thrive Leads cannot work with the current configuration of WordPress SEO. Please go to %s and disable the %s"Redirect ugly URL\'s to clean permalinks"%s option',
'thrive-cb' ), $link, '', '' );
echo sprintf( '
'
* }
*
* This function will correct the $content, transforming it into:
*
etc
*
* @param string $output
* @param string $tag
* @param array $attr
* @param array $m
*
* @return string
*/
function tcb_ensure_shortcode_html_structure( $output, $tag, $attr, $m ) {
if ( isset( $m[5] ) && ! empty( $m[5] ) && strpos( $output, 'thrv_text_element' ) !== false ) {
$content = $m[5];
$closed_tags = '#^(|
)#';
while ( preg_match( $closed_tags, $content, $match ) === 1 ) {
$content = substr( $content, strlen( $match[1] ) ) . $match[1];
}
$output = str_replace( $m[5], $content, $output );
}
return $output;
}
add_filter( 'do_shortcode_tag', 'tcb_ensure_shortcode_html_structure', 10, 4 );
/**
* Re-Add template_include filters after remove_all_filters( 'template_include' );
*/
function tve_compat_re_add_template_include_filters() {
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
if ( is_plugin_active( 'maintenance/maintenance.php' ) ) {
global $mtnc;
if ( ! empty( $mtnc ) ) {
add_action( 'template_include', [ $mtnc, 'mtnc_template_include' ], 999999 );
}
}
}
/**
* Compat Function that contains compatibility fixes for Thrive Architect On plugins_loaded hook
*/
function tve_compat_plugins_loaded_hook() {
global $sitepress;
if ( ! empty( $sitepress ) && ! empty( $_REQUEST[ TVE_EDITOR_FLAG ] ) ) {
remove_action( 'init', [ $sitepress, 'js_load' ], 2 );
}
}
/**
* Digital Access Pass %% links in the content, e.g.: %%LOGIN_FORM%%
*
* @param string $content content with possible shortcodes
*
* @return string updated content
*/
function tcb_dap_shortcode_in_content( $content ) {
if ( function_exists( 'dap_login' ) ) {
$content = dap_login( $content );
}
if ( function_exists( 'dap_personalize' ) ) {
$content = dap_personalize( $content );
}
if ( function_exists( 'dap_personalize_error' ) ) {
$content = dap_personalize_error( $content );
}
if ( function_exists( 'dap_product_links' ) ) {
$content = dap_product_links( $content );
}
return $content;
}
add_action( 'plugins_loaded', 'tve_compat_plugins_loaded_hook' );
/**
* Added hooks to ensure compatibility between TAR and WP Last Modified Info plugin
*/
add_filter( 'wplmi_display_priority_post', 'tve_wp_last_modified_info' );
add_filter( 'wplmi_display_priority_page', 'tve_wp_last_modified_info' );
/**
* Compatibility with WP Last Modified Info plugin
*
* WP Market:
* https://wordpress.org/plugins/wp-last-modified-info/
*
* GIT Source Code:
* https://github.com/iamsayan/wp-last-modified-info
*
* @param int $hook_priority
*
* @return int
*/
function tve_wp_last_modified_info( $hook_priority = 10 ) {
if ( ! is_editor_page_raw() ) {
$hook_priority = PHP_INT_MAX;
}
return $hook_priority;
}
/**
* Compatibility with Imagify plugin
*/
add_filter( 'imagify_allow_picture_tags_for_webp', 'tve_prevent_imagify_webp' );
/**
* Don’t use `