This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load admin scripts & styles | |
function km_load_admin_scripts( $hook ) { | |
global $post; | |
// Load the scripts & styles below only if we're creating/updating a post | |
if ( $hook == 'post-new.php' || $hook == 'post.php' ) { | |
wp_enqueue_script( 'admin_scripts', get_template_directory_uri() . 'assets/js/km_dashboard_admin.js', array( 'jquery' ) ); | |
wp_enqueue_style( 'admin_styles', get_template_directory_uri() . 'assets/css/km_dashboard_admin.css' ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function ( $ ) { | |
$( document ).ready( function () { | |
//Require post title when adding/editing Project Summaries | |
$( 'body' ).on( 'submit.edit-post', '#post', function () { | |
// If the title isn't set | |
if ( $( "#title" ).val().replace( / /g, '' ).length === 0 ) { | |
// Show the alert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load admin scripts & styles | |
function km_load_admin_scripts( $hook ) { | |
global $post; | |
// Load the scripts & styles below only if we're creating/updating a post | |
if ( $hook == 'post-new.php' || $hook == 'post.php' ) { | |
wp_enqueue_script( 'admin_scripts', get_template_directory_uri() . 'assets/js/km_dashboard_admin.js', array( 'jquery' ) ); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'km_load_admin_scripts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load admin scripts & styles | |
function km_load_admin_scripts( $hook ) { | |
global $post; | |
// If the post we're editing isn't a project_sumary type, exit this function | |
if ( 'project_summary' != $post->post_type ) { | |
return; | |
} | |
// Load the scripts & styles below only if we're creating/updating the post |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load admin scripts & styles | |
function km_load_admin_scripts( $hook ) { | |
global $post; | |
// If the post we're editing isn't a project_summary type, exit this function | |
if ( 'project_summary' != $post->post_type ) { | |
return; | |
} | |
// Load the scripts & styles below only if we're creating/updating the post |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hmc_metaboxes( array $meta_boxes ) { | |
$meta_boxes['home_metabox'] = array( | |
'id' => '_hmc_home_metabox2', | |
'title' => __( 'Key Facts', 'hmc' ), | |
'pages' => array( 'page' ), | |
'show_on' => array( 'key' => 'page-template', 'value' => 'templates/home-page.php' ), | |
'context' => 'normal', | |
'priority' => 'default', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.single-property { | |
// CSS rules go here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( $ ) { | |
$( window ).load( function() { | |
// When 'Use Portal Color Controls' customizer control is toggled | |
wp.customize( 'portal_color_control', function ( value ) { | |
value.bind( function( newval ) { | |
// If toggled off, warn user that portal color settings will be deleted | |
if ( 'off' == newval ) { | |
var confirmation = window.confirm( "WARNING: turning this off will delete all the portal color settings. Continue?" ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function km_enqueue_customizer_scripts() { | |
global $wp_customize; | |
if ( ! isset( $wp_customize ) ) { | |
return; | |
} | |
wp_enqueue_script( 'customizer_scripts', PLUGIN_URL . 'assets/js/customizer_scripts.js', 'jquery' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'km_enqueue_customizer_scripts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( $ ) { | |
$( window ).load( function() { | |
// When 'Use Portal Color Controls' customizer control is toggled | |
wp.customize( 'portal_color_control', function ( value ) { | |
value.bind( function( newval ) { | |
// If toggled off, warn user that portal color settings will be deleted | |
if ( 'off' == newval ) { | |
var confirmation = window.confirm( "WARNING: turning this off will delete all the portal color settings. Continue?" ); |