File: /home/alfouzantranspor/www/wp-content/themes/transportation-agency-pro/functions.php
<?php
/**
* Theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
*/
// Theme Setup
if ( ! function_exists( 'transportation_agency_block_support' ) ) :
function transportation_agency_block_support() {
load_theme_textdomain( 'transportation-agency-pro', get_template_directory() . '/languages' );
// Add support for block styles.
add_theme_support( 'wp-block-styles' );
// Add support for WooCommerce
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
// Enqueue editor styles.
add_editor_style( 'editor-style.css' );
}
endif;
add_action( 'after_setup_theme', 'transportation_agency_block_support' );
define( 'TITANTHEMES_THEME_LICENCE_ENDPOINT', 'https://license.titanthemes.net/api/public/' );
function transportation_agency_problock_style_load() {
$theme_version = wp_get_theme()->get( 'Version' );
$version_string = is_string( $theme_version ) ? $theme_version : false;
wp_register_style(
'transportation_agency_problock_style_load',
get_template_directory_uri() . '/editor-style.css',
array(),
$version_string
);
wp_enqueue_style( 'transportation_agency_problock_style_load' );
}
add_action( 'enqueue_block_editor_assets', 'transportation_agency_problock_style_load' );
// Load Styles/Scripts
if ( ! function_exists( 'transportation_agency_problock_styles' ) ) :
function transportation_agency_problock_styles() {
// Register theme stylesheet.
wp_register_style('transportation-agency-pro-style', get_template_directory_uri() . '/style.css', array());
// Add styles inline.
wp_add_inline_style( 'transportation-agency-pro-style', transportation_agency_problock_get_font_face_styles() );
// Enqueue theme stylesheet.
wp_enqueue_style( 'transportation-agency-pro-style' );
if ( is_rtl() ) {
wp_enqueue_style('rtl-css',get_template_directory_uri().'/assets/css/rtl.css', 'rtl_css' );
}
// Enqueue jquery.
wp_enqueue_script('jquery');
}
endif;
add_action( 'wp_enqueue_scripts', 'transportation_agency_problock_styles' );
// Get font face styles.
if ( ! function_exists( 'transportation_agency_problock_get_font_face_styles' ) ) {
function transportation_agency_problock_get_font_face_styles() {
return "
@font-face{font-family: 'Poppins'; font-weight: 100; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-Thin.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 100; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-ThinItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 200; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-ExtraLight.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 200; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-ExtraLightItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 300; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-Light.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 300; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-LightItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 400; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-Regular.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 400; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-Italic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 500; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-Medium.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 500; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-MediumItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 600; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-SemiBold.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 600; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-SemiBoldItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 700; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-Bold.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 700; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-BoldItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 800; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-ExtraBold.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 800; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-ExtraBoldItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 900; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-Black.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Poppins'; font-weight: 900; font-style: italic; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Poppins-BlackItalic.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Oswald'; font-weight: 200; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Oswald-ExtraLight.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Oswald'; font-weight: 300; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Oswald-Light.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Oswald'; font-weight: 400; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Oswald-Regular.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Oswald'; font-weight: 500; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Oswald-Medium.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Oswald'; font-weight: 600; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Oswald-SemiBold.woff2' ) . "') format('woff2');}
@font-face{font-family: 'Oswald'; font-weight: 700; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/Oswald-Bold.woff2' ) . "') format('woff2');}
";
}
}
add_filter( 'woocommerce_prevent_automatic_wizard_redirect', '__return_true' );
// Add block patterns
require get_template_directory() . '/includes/block-patterns.php';
require get_template_directory() . '/theme-wizard/config.php';
require get_parent_theme_file_path('/theme-wizard/plugin-activation.php' );
/* Theme enqueue scripts */
function transportation_agency_problock_scripts() {
// *-*-*-*-*-*-*
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/assets/css/bootstrap.min.css' );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array( 'jquery' ) );
wp_enqueue_script( 'vw-customscripts', get_template_directory_uri() . '/assets/js/custom.js');
wp_enqueue_style( 'other-page-style', get_template_directory_uri().'/assets/css/other-page.css' );
wp_enqueue_style( 'responsive-style', get_template_directory_uri().'/assets/css/media.css',true, null,'screen and (max-width: 3000px) and (min-width: 0px)' );
}
add_action( 'wp_enqueue_scripts', 'transportation_agency_problock_scripts' );
// *-*-*-*-*-*-*-* Nav Menu -*-*-*-*-*-*-*-*-*-*-*
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'a-transportation-agency-pro' ),
) );
register_nav_menus( array(
'footer' => __( 'Footer Menu', 'a-transportation-agency-pro' ),
) );
// *-*-*-*-*-*-*-* Post Type Start -*-*-*-*-*-*-*-*-*-*-*
add_action( 'init', 'transportation_agency_problock_posttype_create_post_type', 0 );
function transportation_agency_problock_posttype_create_post_type() {
// -*-*-*-*-*- Service Start *-*-*-*-*-*-*-*
// services
$service_labels = array(
'name' => _x( 'Services', 'Post Type General Name', 'transportation-agency-pro-posttype' ),
'singular_name' => _x( 'Service', 'Post Type Singular Name', 'transportation-agency-pro-posttype' ),
'menu_name' => __( 'Services', 'transportation-agency-pro-posttype' ),
'parent_item_colon' => __( 'Parent Service', 'transportation-agency-pro-posttype' ),
'all_items' => __( 'All Services', 'transportation-agency-pro-posttype' ),
'view_item' => __( 'View Service', 'transportation-agency-pro-posttype' ),
'add_new_item' => __( 'Add New Service', 'transportation-agency-pro-posttype' ),
'add_new' => __( 'Add New', 'transportation-agency-pro-posttype' ),
'edit_item' => __( 'Edit Service', 'transportation-agency-pro-posttype' ),
'update_item' => __( 'Update Service', 'transportation-agency-pro-posttype' ),
'search_items' => __( 'Search Service', 'transportation-agency-pro-posttype' ),
'not_found' => __( 'Not Found', 'transportation-agency-pro-posttype' ),
'not_found_in_trash' => __( 'Not found in Trash', 'transportation-agency-pro-posttype' ),
);
// Set other options for Custom Post Type
$service_args = array(
'label' => __( 'services', 'transportation-agency-pro-posttype' ),
'description' => __( 'Service news and reviews', 'transportation-agency-pro-posttype' ),
'labels' => $service_labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
'menu_icon' => 'dashicons-portfolio',
// This is where we add taxonomies to our CPT
'taxonomies' => array( 'services_category' ),
);
// Registering your Custom Post Type
register_post_type( 'services', $service_args );
// Register taxonomy
$service_labels = array(
'name' => _x( 'Service Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Service Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Service Categories' ),
'popular_items' => __( 'Popular Service Categories' ),
'all_items' => __( 'All Service Categories' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Service Category' ),
'update_item' => __( 'Update Service Category' ),
'add_new_item' => __( 'Add New Service Category' ),
'new_item_name' => __( 'New Service Category Name' ),
'separate_items_with_commas' => __( 'Separate services categories with commas' ),
'add_or_remove_items' => __( 'Add or remove services categories' ),
'choose_from_most_used' => __( 'Choose from the most used services categories' ),
'menu_name' => __( 'Service Categories' ),
);
// Now register the non-hierarchical taxonomy like tag
register_taxonomy( 'services_category', 'services', array(
'hierarchical' => false,
'labels' => $service_labels,
'show_ui' => true,
'show_in_rest' => true,
'show_admin_column' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'services_category' ),
));
// -*-*-*-*-*- Service End *-*-*-*-*-*-*-*
// -*-*-*-*-*- Place Start *-*-*-*-*-*-*-*
// places
$place_labels = array(
'name' => _x( 'places', 'Post Type General Name', 'transportation-agency-pro-posttype' ),
'singular_name' => _x( 'place', 'Post Type Singular Name', 'transportation-agency-pro-posttype' ),
'menu_name' => __( 'places', 'transportation-agency-pro-posttype' ),
'parent_item_colon' => __( 'Parent place', 'transportation-agency-pro-posttype' ),
'all_items' => __( 'All places', 'transportation-agency-pro-posttype' ),
'view_item' => __( 'View place', 'transportation-agency-pro-posttype' ),
'add_new_item' => __( 'Add New place', 'transportation-agency-pro-posttype' ),
'add_new' => __( 'Add New', 'transportation-agency-pro-posttype' ),
'edit_item' => __( 'Edit place', 'transportation-agency-pro-posttype' ),
'update_item' => __( 'Update place', 'transportation-agency-pro-posttype' ),
'search_items' => __( 'Search place', 'transportation-agency-pro-posttype' ),
'not_found' => __( 'Not Found', 'transportation-agency-pro-posttype' ),
'not_found_in_trash' => __( 'Not found in Trash', 'transportation-agency-pro-posttype' ),
);
// Set other options for Custom Post Type
$place_args = array(
'label' => __( 'places', 'transportation-agency-pro-posttype' ),
'description' => __( 'place news and reviews', 'transportation-agency-pro-posttype' ),
'labels' => $place_labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
'menu_icon' => 'dashicons-portfolio',
// This is where we add taxonomies to our CPT
'taxonomies' => array( 'places_category' ),
);
// Registering your Custom Post Type
register_post_type( 'places', $place_args );
// Register taxonomy
$place_labels = array(
'name' => _x( 'place Categories', 'taxonomy general name' ),
'singular_name' => _x( 'place Category', 'taxonomy singular name' ),
'search_items' => __( 'Search place Categories' ),
'popular_items' => __( 'Popular place Categories' ),
'all_items' => __( 'All place Categories' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit place Category' ),
'update_item' => __( 'Update place Category' ),
'add_new_item' => __( 'Add New place Category' ),
'new_item_name' => __( 'New place Category Name' ),
'separate_items_with_commas' => __( 'Separate places categories with commas' ),
'add_or_remove_items' => __( 'Add or remove places categories' ),
'choose_from_most_used' => __( 'Choose from the most used places categories' ),
'menu_name' => __( 'place Categories' ),
);
// Now register the non-hierarchical taxonomy like tag
register_taxonomy( 'places_category', 'places', array(
'hierarchical' => false,
'labels' => $place_labels,
'show_ui' => true,
'show_in_rest' => true,
'show_admin_column' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'places_category' ),
));
// -*-*-*-*-*- Place End *-*-*-*-*-*-*-*
}
// *-*-*-*-*-*-*-* Post Type End -*-*-*-*-*-*-*-*-*-*-*
// -*-*--*-*-*-*-*-*-*-*-* Blog Meta Field Start-*-*-*-*-*-*-*-*-*-*-*
function transportation_agency_problock_posttype_images_event_metabox_enqueue($hook) {
if ( 'post.php' === $hook || 'post-new.php' === $hook ) {
// wp_enqueue_script('transportation-agency-pro-metabox', plugin_dir_url( __FILE__ ) . '/js/img-metabox.js', array('jquery', 'jquery-ui-sortable'));
wp_enqueue_script( 'transportation-agency-pro-metabox', get_template_directory_uri().'/assets/js/img-metabox.js', array('jquery', 'jquery-ui-sortable') );
global $post;
if ( $post ) {
wp_enqueue_media( array(
'post' => $post->ID,
)
);
}
}
wp_enqueue_script( 'vw-auto-recovery', get_template_directory_uri() . '/assets/js/block-recovery.js');
}
add_action('admin_enqueue_scripts', 'transportation_agency_problock_posttype_images_event_metabox_enqueue');
if (is_admin()){
add_action('admin_menu', 'transportation_agency_problock_posttype_bn_custom_meta_news');
}
function transportation_agency_problock_posttype_bn_custom_meta_news() {
add_meta_box( 'bn_meta', __( 'News Meta', 'transportation-agency-pro-posttype' ), 'transportation_agency_problock_posttype_bn_meta_callback_news', 'post', 'normal', 'high' );
}
function transportation_agency_problock_posttype_bn_meta_callback_news( $post ) {
wp_nonce_field( basename( __FILE__ ), 'bn_nonce' );
$bn_stored_meta = get_post_meta( $post->ID );
$meta_blog_question = get_post_meta( $post->ID, 'meta-blog-que', true );
$meta_blog_para = get_post_meta( $post->ID, 'meta-blog-para', true );
$meta_blog_text = get_post_meta( $post->ID, 'meta-blog-text', true );
$single_img1 = get_post_meta($post->ID,'meta-image1',true);
$single_img2 = get_post_meta($post->ID,'meta-image2',true);
?>
<?php esc_html_e( 'Blog Title', 'transportation-agency-pro-posttype' )?>
<input type="text" name="meta-blog-que" id="meta-blog-que" value="<?php echo esc_html($meta_blog_question); ?>" /><br><br>
<?php esc_html_e( 'Blog Paragraph 1', 'transportation-agency-pro-posttype' )?>
<input name="meta-blog-para" id="meta-blog-para" value="<?php echo esc_html($meta_blog_para); ?>" /><br><br>
<?php esc_html_e( 'Blog Paragraph 2', 'transportation-agency-pro-posttype' )?>
<input name="meta-blog-text" id="meta-blog-text" value="<?php echo esc_html($meta_blog_text); ?>" /><br><br>
Single Image 1
<input type="text" name="meta-image1" id="meta-image1" class="meta-image regular-text" value="<?php echo esc_html($single_img1); ?>">
<input type="button" class="button image-upload1" value="Browse"><br><br>
Single Image 2
<input type="text" name="meta-image2" id="meta-image2" class="meta-image regular-text" value="<?php echo esc_html($single_img2); ?>">
<input type="button" class="button image-upload2" value="Browse">
<?php
}
function transportation_agency_problock_posttype_bn_meta_save_news( $post_id ) {
if (!isset($_POST['bn_nonce']) || !wp_verify_nonce($_POST['bn_nonce'], basename(__FILE__))) {
return;
}
if (!current_user_can('edit_post', $post_id)) {
return;
}
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
}
// Team Meta 1
if( isset( $_POST[ 'meta-blog-que' ] ) ) {
update_post_meta( $post_id, 'meta-blog-que', sanitize_text_field($_POST[ 'meta-blog-que' ]) );
}
if( isset( $_POST[ 'meta-blog-para' ] ) ) {
update_post_meta( $post_id, 'meta-blog-para', sanitize_text_field($_POST[ 'meta-blog-para' ]) );
}
// Team Meta 2
if( isset( $_POST[ 'meta-blog-text' ] ) ) {
update_post_meta( $post_id, 'meta-blog-text', sanitize_text_field($_POST[ 'meta-blog-text' ]) );
}
if( isset( $_POST[ 'meta-image1' ] ) ) {
update_post_meta( $post_id, 'meta-image1', esc_url_raw($_POST[ 'meta-image1' ]) );
}
if( isset( $_POST[ 'meta-image2' ] ) ) {
update_post_meta( $post_id, 'meta-image2', esc_url_raw($_POST[ 'meta-image2' ]) );
}
if( isset( $_POST[ 'meta-url' ] ) ) {
update_post_meta( $post_id, 'meta-url', esc_url_raw($_POST[ 'meta-url' ]) );
}
}
add_action( 'save_post', 'transportation_agency_problock_posttype_bn_meta_save_news' );
// -*-*--*-*-*-*-*-*-*-*-* Blog Meta Field End -*-*-*-*-*-*-*-*-*-*-*
// -*-*--*-*-*-*-*-*-*-*-* Place Meta Field Start-*-*-*-*-*-*-*-*-*-*-*
if (is_admin()){
add_action('admin_menu', 'transportation_agency_problock_posttype_bn_custom_meta_places');
}
function transportation_agency_problock_posttype_bn_custom_meta_places() {
add_meta_box( 'bn_meta', __( 'Places Meta', 'transportation-agency-pro-posttype' ), 'transportation_agency_problock_posttype_bn_meta_callback_places', 'places', 'normal', 'high' );
}
function transportation_agency_problock_posttype_bn_meta_callback_places( $post ) {
wp_nonce_field( basename( __FILE__ ), 'bn_nonce' );
$bn_stored_meta = get_post_meta( $post->ID );
$meta_place_content = get_post_meta( $post->ID, 'meta-place-content', true );
$meta_place_feature = get_post_meta( $post->ID, 'meta-place-feature-content', true );
$meta_place_feature_one = get_post_meta( $post->ID, 'meta-place-feature-one', true );
$meta_place_feature_two = get_post_meta( $post->ID, 'meta-place-feature-two', true );
$meta_place_feature_three = get_post_meta( $post->ID, 'meta-place-feature-three', true );
$meta_place_feature_four = get_post_meta( $post->ID, 'meta-place-feature-four', true );
$meta_place_other_location = get_post_meta( $post->ID, 'meta-place-other-location', true );
$meta_place_shortcode = get_post_meta($post->ID,'meta-place-shortcode',true);
?>
<?php esc_html_e( 'Place Description', 'transportation-agency-pro-posttype' )?>
<input type="text" name="meta-place-content" id="meta-place-content" value="<?php echo esc_html($meta_place_content); ?>" /><br><br>
<?php esc_html_e( 'Place Feature Content', 'transportation-agency-pro-posttype' )?>
<input name="meta-place-feature-content" id="meta-place-feature-content" value="<?php echo esc_html($meta_place_feature); ?> "/><br><br>
<?php esc_html_e( 'Place Feature 1', 'transportation-agency-pro-posttype' )?>
<input name="meta-place-feature-one" id="meta-place-feature-one" value=" <?php echo esc_html($meta_place_feature_one); ?> "/><br>
<?php esc_html_e( 'Place Feature 2', 'transportation-agency-pro-posttype' )?>
<input name="meta-place-feature-two" id="meta-place-feature-two" value=" <?php echo esc_html($meta_place_feature_two); ?> "/><br>
<?php esc_html_e( 'Place Feature 3', 'transportation-agency-pro-posttype' )?>
<input name="meta-place-feature-three" id="meta-place-feature-three" value=" <?php echo esc_html($meta_place_feature_three); ?> "/><br>
<?php esc_html_e( 'Place Feature 4', 'transportation-agency-pro-posttype' )?>
<input name="meta-place-feature-four" id="meta-place-feature-four" value=" <?php echo esc_html($meta_place_feature_four); ?> "/><br>
<?php esc_html_e( 'Place Other Location', 'transportation-agency-pro-posttype' )?>
<input name="meta-place-other-location" id="meta-place-other-location" value="<?php echo esc_html($meta_place_other_location); ?>" /><br><br>
<?php esc_html_e( 'Place Form Shortcode', 'transportation-agency-pro-posttype' )?>
<input name="meta-place-shortcode" id="meta-place-shortcode" class="meta-image regular-text" value="<?php echo esc_html($meta_place_shortcode); ?>">
<?php
}
function transportation_agency_problock_posttype_bn_meta_save_places( $post_id ) {
if (!isset($_POST['bn_nonce']) || !wp_verify_nonce($_POST['bn_nonce'], basename(__FILE__))) {
return;
}
if (!current_user_can('edit_post', $post_id)) {
return;
}
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
}
// Team Meta 1
if( isset( $_POST[ 'meta-place-content' ] ) ) {
update_post_meta( $post_id, 'meta-place-content', sanitize_text_field($_POST[ 'meta-place-content' ]) );
}
if( isset( $_POST[ 'meta-place-feature-content' ] ) ) {
update_post_meta( $post_id, 'meta-place-feature-content', sanitize_text_field($_POST[ 'meta-place-feature-content' ]) );
}
if( isset( $_POST[ 'meta-place-feature-one' ] ) ) {
update_post_meta( $post_id, 'meta-place-feature-one', sanitize_text_field($_POST[ 'meta-place-feature-one' ]) );
}
if( isset( $_POST[ 'meta-place-feature-two' ] ) ) {
update_post_meta( $post_id, 'meta-place-feature-two', sanitize_text_field($_POST[ 'meta-place-feature-two' ]) );
}
if( isset( $_POST[ 'meta-place-feature-three' ] ) ) {
update_post_meta( $post_id, 'meta-place-feature-three', sanitize_text_field($_POST[ 'meta-place-feature-three' ]) );
}
if( isset( $_POST[ 'meta-place-feature-four' ] ) ) {
update_post_meta( $post_id, 'meta-place-feature-four', sanitize_text_field($_POST[ 'meta-place-feature-four' ]) );
}
// Team Meta 2
if( isset( $_POST[ 'meta-place-other-location' ] ) ) {
update_post_meta( $post_id, 'meta-place-other-location', sanitize_text_field($_POST[ 'meta-place-other-location' ]) );
}
if( isset( $_POST[ 'meta-place-shortcode' ] ) ) {
update_post_meta( $post_id, 'meta-place-shortcode', esc_url_raw($_POST[ 'meta-place-shortcode' ]) );
}
if( isset( $_POST[ 'meta-url' ] ) ) {
update_post_meta( $post_id, 'meta-url', esc_url_raw($_POST[ 'meta-url' ]) );
}
}
add_action( 'save_post', 'transportation_agency_problock_posttype_bn_meta_save_places' );
// -*-*--*-*-*-*-*-*-*-*-* Place Meta Field End -*-*-*-*-*-*-*-*-*-*-*
function custom_hover_style() {
?>
<style>
.service-home-page-grid .is-grid .o-posts-grid-post-blog .o-posts-grid-post:hover {
background-image: url('<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/Image.png');
background-size: cover;
background-position: center;
}
</style>
<?php
}
add_action('wp_head', 'custom_hover_style');