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 | |
/** | |
* Plugin name: Different theme for guest than logged in user | |
*/ | |
// You can also put this file in mu-plugins dir. | |
add_filter( 'template', 'switch_theme__db' ); | |
add_filter( 'stylesheet', 'switch_theme__db' ); |
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
int cell_size = 4; | |
int canvas_size = cell_size * 200; | |
StringList coordinates_of_alive_cells; | |
void setup () { | |
size( canvas_size, canvas_size ); | |
// Initial pattern | |
coordinates_of_alive_cells = new StringList(); | |
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 | |
// Example: | |
$data_from_api = LibraryOfCachableFunctions::get_some_data_from_api( $args ); | |
// LibraryOfCachableFunctions does not have a get_some_data_from_api() function. | |
// This causes __callStatic() to be called. __callStatic() takes care of caching. | |
// if the results are not available in the cache, it calls a function by adding an underscore to the name of the called function. | |
// the _get_some_data_from_api() function is used to obtain the results and store them in the cache. |
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 | |
/** | |
* Plugin Name: Custom CSS for wp-impress-js | |
*/ | |
add_action( 'impress_head', 'mask_custom_css_for_wp_impress_js' ); | |
function mask_custom_css_for_wp_impress_js() { | |
?> | |
<style> |
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'; | |
} |
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 | |
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 | |
$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
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 |
NewerOlder