* @package vamtam/consulting */ /** * class VamtamAdmin */ class VamtamAdmin { /** * Initialize the theme admin */ public static function actions() { if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) { add_action( 'admin_init', array( 'VamtamUpdateNotice', 'check' ) ); } add_action( 'admin_footer', array( __CLASS__, 'icons_selector' ) ); add_action( 'add_meta_boxes', array( __CLASS__, 'load_metaboxes' ) ); add_action( 'save_post', array( __CLASS__, 'load_metaboxes' ) ); add_filter( 'admin_notices', array( __CLASS__, 'update_warning' ) ); add_action( 'admin_init', array( __CLASS__, 'setup_settings' ) ); self::load_functions(); new VamtamPurchaseHelper; new VamtamHelpPage; require_once VAMTAM_ADMIN_HELPERS . 'updates/version-checker.php'; if ( ! get_option( VAMTAM_THEME_SLUG . '_vamtam_theme_activated', false ) ) { update_option( VAMTAM_THEME_SLUG . '_vamtam_theme_activated', true ); delete_option( 'default_comment_status' ); } } public static function setup_settings() { add_settings_field( 'vamtam_custom_font_families', esc_html__( 'Custom Font Families', 'vamtam-consulting' ), array( __CLASS__, 'custom_font_families_settings_field' ), 'general' ); register_setting( 'general', 'vamtam_custom_font_families' ); add_settings_field( 'vamtam_featured_images_ratio', esc_html__( 'Featured images width-to-height ratio', 'vamtam-consulting' ), array( __CLASS__, 'featured_images_settings_field' ), 'media' ); register_setting( 'media', 'vamtam_featured_images_ratio' ); } public static function custom_font_families_settings_field() { $value = get_option( 'vamtam_custom_font_families' ); ?>

1.3, VAMTAM_THUMBNAIL_PREFIX . 'single' => 1.3, ) ); ?>
Large size

Regenerate thumbnails plugin in order to update your images.', 'vamtam-consulting' ), 'http://wordpress.org/extend/plugins/regenerate-thumbnails/' ) ) ?>

'; ; esc_html_e( 'Hey, just a polite reminder that if you update WordPress you will also need to update your theme and plugins.', 'vamtam-consulting' ); echo ''; echo '

'; printf( wp_kses_post( __( 'You should see any available theme updates on this page if you have entered your purchase information in Settings / VamTam Purchase', 'vamtam-consulting' ) ), esc_url( admin_url( 'themes.php?page=vamtam_theme_setup' ) ) ); echo '

'; esc_html_e( "Please note that if we haven't released an update, you shouldn't update your WordPress and plugins until we release one. Otherwise you may run into various compatibility issues.", 'vamtam-consulting' ); echo '

'; printf( wp_kses_post( __( 'If you are unsure as to whether it is safe to update your site, please do ask us at %2$s and we\'ll help you.', 'vamtam-consulting' ) ), esc_url( 'http://support.vamtam.com' ), 'our support site' ); echo '

'; } if ( did_action( 'load-update-core.php' ) || did_action( 'load-themes.php' ) ) { echo '

'; ; esc_html_e( 'VamTam theme resources: ', 'vamtam-consulting' ); echo ''; echo ''; esc_html_e( 'Sample child themes', 'vamtam-consulting' ); echo '; '; echo ''; esc_html_e( 'Changelog', 'vamtam-consulting' ); echo ''; echo '

'; } } public static function icons_selector() { ?> 'testimonials-post-options', 'title' => esc_html__( 'VamTam Testimonials', 'vamtam-consulting' ), 'pages' => array( 'jetpack-testimonial' ), 'context' => 'normal', 'priority' => 'high', 'post_id' => $post_id, ); $options = include VAMTAM_METABOXES . 'testimonials.php'; new VamtamMetaboxesGenerator( $config, $options ); $config = array( 'id' => 'vamtam-post-format-options', 'title' => esc_html__( 'VamTam Post Formats', 'vamtam-consulting' ), 'pages' => array( 'post' ), 'context' => 'normal', 'priority' => 'high', 'post_id' => $post_id, ); $options = include VAMTAM_METABOXES . 'post-formats.php'; new VamtamMetaboxesGenerator( $config, $options ); $config = array( 'id' => 'vamtam-portfolio-format-options', 'title' => esc_html__( 'Project Formats', 'vamtam-consulting' ), 'pages' => array( 'jetpack-portfolio' ), 'context' => 'normal', 'priority' => 'high', 'post_id' => $post_id, ); $options = include VAMTAM_METABOXES . 'portfolio-formats.php'; new VamtamMetaboxesGenerator( $config, $options ); $config = array( 'id' => 'vamtam-portfolio-formats-select', 'title' => esc_html__( 'Project Format', 'vamtam-consulting' ), 'pages' => array( 'jetpack-portfolio' ), 'context' => 'side', 'priority' => 'high', 'post_id' => $post_id, ); $options = include VAMTAM_METABOXES . 'portfolio-formats-select.php'; new VamtamMetaboxesGenerator( $config, $options ); $config = array( 'id' => 'general-post-options', 'title' => esc_html__( 'VamTam Options', 'vamtam-consulting' ), 'pages' => VamtamFramework::$complex_layout, 'context' => 'normal', 'priority' => 'high', 'post_id' => $post_id, ); $options = include VAMTAM_METABOXES . 'general.php'; new VamtamMetaboxesGenerator( $config, $options ); } /** * Admin helper functions */ private static function load_functions() { require_once VAMTAM_ADMIN_HELPERS . 'base.php'; } }