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
| // Demo: http://jsfiddle.net/xuyp8qb5/ | |
| // Note: You need Google Map API Key to run demo; bit.ly/2pBgToW | |
| var latlng; | |
| latlng = new google.maps.LatLng(40.730885, -73.997383); // New York, US | |
| //latlng = new google.maps.LatLng(37.990849233935194, 23.738339349999933); // Athens, GR | |
| //latlng = new google.maps.LatLng(48.8567, 2.3508); // Paris, FR | |
| //latlng = new google.maps.LatLng(47.98247572667902, -102.49018710000001); // New Town, US | |
| //latlng = new google.maps.LatLng(35.44448406385493, 50.99001635390618); // Parand, Tehran, IR | |
| //latlng = new google.maps.LatLng(34.66431108560504, 50.89113940078118); // Saveh, Markazi, IR |
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 | |
| // Retrieve sites ID and path in WP multisite | |
| $current_id = get_current_blog_id(); | |
| $args = array('site__not_in' => $current_id); | |
| $network_sites = get_sites($args); | |
| foreach($network_sites as $network_site) { | |
| echo $network_site->blog_id; |
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 hide_the_dashboard() | |
| { | |
| global $current_user; | |
| // is there a user ? | |
| if ( is_array( $current_user->roles ) ) { | |
| // substitute your role(s): | |
| if ( in_array( 'author', $current_user->roles ) ) { | |
| // hide the dashboard: | |
| remove_menu_page( 'index.php' ); |
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 | |
| /** | |
| * [list_searcheable_acf list all the custom fields we want to include in our search query] | |
| * @return [array] [list of custom fields] | |
| */ | |
| function list_searcheable_acf(){ | |
| $list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
| return $list_searcheable_acf; | |
| } |
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 | |
| $terms = get_the_terms( $post->ID, 'area'); | |
| $postid = get_the_ID(); | |
| foreach ($terms as $term) { | |
| $posts = get_posts(array( | |
| 'posts_per_page'=> -1, |
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 | |
| $posts = get_posts(array( | |
| 'posts_per_page' => 3, | |
| 'post_type' => 'news' | |
| )); | |
| if( $posts ): ?> | |
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 capital_P_dangit( $text ); ?> |
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 | |
| // disable for posts | |
| add_filter('use_block_editor_for_post', '__return_false', 10); | |
| // disable for post types | |
| add_filter('use_block_editor_for_post_type', '__return_false', 10); |
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 | |
| // Remove Admin bar | |
| function remove_admin_bar() { | |
| return false; | |
| } |
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 get_wp_core_updates() { | |
| require_once ABSPATH . '/wp-admin/includes/update.php'; | |
| return get_core_updates(); | |
| } | |
| add_action( 'rest_api_init', function () { | |
| register_rest_route( 'wp/v2', 'wp-version',array( | |
| 'methods' => 'GET', |
NewerOlder