This file contains 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 | |
wp_enqueue_script( | |
$handle ='my-js', | |
$src = get_stylesheet_directory_uri() . '/js/my.js', | |
$deps = array( 'jquery' ), | |
$ver = '0.01', | |
$in_footer = true | |
); |
This file contains 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 | |
define( 'DB_VH_REWRITE_TAG', 'feed-relay' ); | |
add_action( 'init', 'db_vh_create_feeds_relay_urls' ); | |
function db_vh_create_feeds_relay_urls() { | |
add_rewrite_rule( | |
$rule = 'feeds/(.*)/?', | |
$rewrite = 'index.php?' . DB_VH_REWRITE_TAG . '=$matches[1]', |
This file contains 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
sub vcl_fetch { | |
if ( obj.status >= 500 ) { | |
set obj.ttl = 0s; | |
set obj.cacheable = false; | |
} | |
} |
This file contains 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 wf_fbc_create_and_send_excel_spreadsheet_to_browser( $headings, $data ) { | |
ini_set('include_path', ini_get('include_path'). PATH_SEPARATOR . dirname( __FILE__) . '/lib/phpexcel/Classes/'); | |
include 'PHPExcel.php'; | |
include 'PHPExcel/Writer/Excel5.php'; | |
$objPHPExcel = new PHPExcel(); | |
$objPHPExcel->setActiveSheetIndex(0); | |
$objPHPExcel->getDefaultStyle()->getFont()->setName('Times New Roman'); | |
$objPHPExcel->getDefaultStyle()->getFont()->setSize(10); | |
$objPHPExcel->getActiveSheet()->getStyle('1')->applyFromArray(array( 'font' => array('bold' => true,),)); |
This file contains 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
add_action( 'wp_enqueue_scripts', 'my_pjn_scripts_and_styles'); | |
function my_pjn_scripts_and_styles() { | |
if ( is_page( 'some-page-slug' ) ) { | |
wp_enqueue_script( | |
$handle = 'googlemap', | |
$src = "http://maps.googleapis.com/maps/api/js?sensor=true", | |
$deps = array(), | |
$ver = 'V3', | |
$in_footer = true |
This file contains 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 | |
$administrator = get_role( 'administrator' ); | |
foreach ( | |
array( 'activate_plugins', 'delete_others_pages', 'delete_others_posts', 'delete_pages', 'delete_plugins', 'delete_posts', 'delete_private_pages', 'delete_private_posts', 'delete_published_pages', 'delete_published_posts', 'edit_dashboard', 'edit_files', 'edit_others_pages', 'edit_others_posts', 'edit_pages', 'edit_posts', 'edit_private_pages', 'edit_private_posts', 'edit_published_pages', 'edit_published_posts', 'edit_theme_options', 'export', 'import', 'list_users', 'manage_categories', 'manage_links', 'manage_options', 'moderate_comments', 'promote_users', 'publish_pages', 'publish_posts', 'read_private_pages', 'read_private_posts', 'read', 'remove_users', 'switch_themes', 'upload_files', 'create_product', ) | |
as $cap | |
) { | |
$administrator->add_cap( $cap ); | |
} |
This file contains 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
when_the_user_indicates_which_classes_they_wanna_see_homework_for( | |
send_user_choice_for_which_classes_they_wanna_see_homework | |
); | |
when_the_user_indicates_which_calendars_they_want_to_see( | |
send_user_choice_of_which_calendars_they_want_to_see | |
); | |
//-----------------Calendar Details-------------------// |
This file contains 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 | |
wp_enqueue_script( $module_slug . '-js', dirname(__FILE__) . '/js/' . $module_slug . '.js', array( 'jquery' ), self::version, true ); | |
wp_enqueue_script( | |
$script_name = $module_slug . '-js', | |
$location = dirname(__FILE__) . '/js/' . $module_slug . '.js', | |
$load_after = array( 'jquery' ), | |
$version_number = self::version, | |
$load_in_footer = true | |
); |
This file contains 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 | |
add_action( 'wp_enqueue_scripts', 'scripts_and_styles__of_me_theme'); | |
function scripts_and_styles__of_me_theme() { | |
if ( is_page( 'forecasts' ) || is_front_page() || is_page( 'radar' ) || is_page( 'historical-data' ) ) { | |
wp_enqueue_script( 'jquery-ui-autocomplete' ); | |
} | |
} |
This file contains 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 | |
$hello = 'world'; | |
get_template_part( 'hello' ); | |
require 'hello.php'; | |
function get_template_part( $filename ) { | |
require $filename . '.php'; | |
} |