', esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'wp_head', 'blog_reflection_pingback_header' );
/**
* Fallback for primary navigation.
*/
if( ! function_exists( 'blog_reflection_primary_navigation_fallback' ) ) :
/**
* Fallback for primary navigation.
*
* @since 1.0.0
*/
function blog_reflection_primary_navigation_fallback() {
echo '
';
}
endif;
/**
* Purchase Link
*/
if ( ! function_exists( 'blogreflection_purchase_link' ) ) {
function blogreflection_purchase_link() {
$blogreflection_purchase = 'https://checkout.freemius.com/mode/dialog/plugin/16758/plan/27963/';
$blog_reflection_description = sprintf(
__( 'Purchase the Pro Version for More Features. Purchase Now', 'blog-reflection' ),
esc_url( $blogreflection_purchase )
);
return $blog_reflection_description;
}
}
// get letest post function
function blog_reflection_get_latest_posts() {
$blog_reflection_args = array(
'numberposts' => -1, // Fetch all posts
'post_type' => 'post'
);
$blog_reflection_posts = get_posts( $blog_reflection_args );
$blog_reflection_choices = array();
foreach ( $blog_reflection_posts as $blog_reflection_post ) {
$blog_reflection_choices[ $blog_reflection_post->ID ] = get_the_title( $blog_reflection_post->ID );
}
return $blog_reflection_choices;
}
//Admin notice
function blog_reflection_admin_notice() {
// Check if the notification should be hidden
$hide_notice = isset($_COOKIE['blog_reflection_admin_notice']) ? intval($_COOKIE['blog_reflection_admin_notice']) : 0;
$blog_reflection_ads_banner_img = get_template_directory_uri() . '/assets/images/ads/upgrade-pro.jpg';
// Get current admin page URL
$current_screen = get_current_screen();
$blog_reflection_ad_url = home_url() . '/wp-admin/admin.php?page=blog-reflection-addons';
// Check if we are on the 'blog-reflection-addons' page
$is_blog_reflection_addons_page = isset($_GET['page']) && $_GET['page'] === 'blog-reflection-addons';
$pro_plan_link = 'https://checkout.freemius.com/mode/dialog/plugin/16758/plan/27963/';
if (!$hide_notice && !$is_blog_reflection_addons_page) {
?>
$demo_data ) {
if ( isset( $selected_import['import_file_name'] ) && $selected_import['import_file_name'] === $demo_data['title'] ) {
// Check if the post with slug 'hello-world' exists and delete it
$post = get_page_by_path( 'hello-world', OBJECT, 'post' );
if ( $post ) {
wp_delete_post( $post->ID, true ); // True to bypass trash and delete permanently
}
break; // Break once the match is found and action is performed
}
}
}
add_action( 'advanced_import_demo_lists/before_content_import', 'blog_reflection_before_content_import' );
function blog_reflection_custom_post_format_script() {
?>
(', ' (', $blog_reflection_links );
$blog_reflection_links = str_replace( ')', ')', $blog_reflection_links );
return $blog_reflection_links;
}
add_filter( 'get_archives_link', 'blog_reflection_span_archive_count' );
/**
* Add span tag in category list count number
*/
function blog_reflection_span_category_count( $blog_reflection_links ) {
$blog_reflection_links = str_replace( ' (', ' (', $blog_reflection_links );
$blog_reflection_links = str_replace( ')', ')', $blog_reflection_links );
return wp_kses_post($blog_reflection_links);
}
add_filter( 'wp_list_categories', 'blog_reflection_span_category_count' );
// author social media share code
function blog_reflection_custom_social_media_share() {
global $post;
$blog_reflection_post_url = urlencode(get_permalink($post->ID));
$blog_reflection_post_title = urlencode(get_the_title($post->ID));
$blog_reflection_fb_url= "https://www.facebook.com/sharer.php?u=".$blog_reflection_post_url;
$blog_reflection_tw_url= "https://twitter.com/share?url=".$blog_reflection_post_url."&text=".$blog_reflection_post_title;
$blog_reflection_in_url= "https://www.linkedin.com/shareArticle?mini=true&url=".$blog_reflection_post_url."&title=".$blog_reflection_post_title;
$blog_reflection_inst_url= "https://www.instagram.com/?url=".$blog_reflection_post_url;
?>
roles : array();
}
// Mobile Menu Register
function blog_reflection_register_mobile_menu() {
register_nav_menu('mobile-menu',__( 'Mobile Menu', 'blog-reflection' ));
}
add_action( 'init', 'blog_reflection_register_mobile_menu' );
function blog_reflection_text_domain_theme_setup() {
load_theme_textdomain('blog-reflection', get_template_directory() . '/languages');
}
add_action('after_setup_theme', 'blog_reflection_text_domain_theme_setup');
function blog_reflection_call_dark_mode()
{
?>
';
return $form;
}
add_filter( 'get_search_form', 'blog_reflection_search_form_with_icon' );