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
<input type="text" name="location_meta[address]" placeholder="Street Address" value=""> | |
<input type="text" name="location_meta[city]" placeholder="City" value="">, | |
<input type="text" name="location_meta[prov]" placeholder="State/Prov" value="">, | |
<select name="location_meta[country]"> | |
<option value='CA'>🇨🇦</option> | |
<option value='US'>🇺🇸</option> | |
</select><br> | |
<input type="text" name="location_meta[postal]" placeholder="Postal/Zip" value=""> | |
<button data-get-geo-cords>Click here to get Lat/Lng from address above</button> |
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 | |
<h3>KM Calculator</h3><?php | |
$key = '************-******************************'; | |
$thispage = '?'; // ex https://localhost/index.php | |
if (isset($_GET['from'])) { | |
$from = urlencode($_GET['from']); | |
$to = urlencode($_GET['to']); |
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
.status-bar-left .ftp-statusbar-view { | |
.icon { | |
color: white !important; | |
position: relative; | |
z-index: 2; | |
&:after { | |
content: ""; | |
display: block; | |
position: absolute; | |
width: 30px; |
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 default Widgets | |
* | |
* @see https://digwp.com/2014/02/disable-default-dashboard-widgets/ | |
*/ | |
add_action('wp_dashboard_setup', function () { | |
global $wp_meta_boxes; | |
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 | |
/** | |
* Set all enqueued scripts except jQuery to include the `async` attribute. | |
* | |
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#Attributes | |
*/ | |
add_filter('script_loader_tag', function ($tag, $handle) { | |
if ( 'jquery' !== $handle ) | |
return $tag; |
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 | |
add_action('admin_menu', function () { | |
$parent_slug = 'edit.php?post_type=page'; // "Pages" | |
$page_title = 'My Plugin Submenu Page'; | |
$menu_title = 'My Plugin Submenu Page'; | |
$capability = 'edit_pages'; | |
$menu_slug = 'myplugin-submenu-page'; | |
$page = 'myplugin_submenu_page'; | |
add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $page); |
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 | |
add_shortcode( 'pdf_redirect', function ( $atts ) { | |
$a = shortcode_atts( array( | |
'url' => '', | |
), $atts ); | |
// instructions in case of misuse | |
if (empty($a['url'])) | |
return "<pre>Please assign a destination for the PDF redirect, [pdf_redirect url='https://yourpdfurl...']</pre>"; |
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 myplugin_find_media($content) { | |
$mediaRegex = "/(src|href)=\"(.+?).(jpg|png|pdf|gif)\"/i"; // your support filetypes | |
$mediaFind = preg_match_all($mediaRegex, $content, $media); | |
if (isset($media[2]) && count($media[2]) > 0) | |
return $media[2]; |
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 | |
add_action('admin_notices', function(){ | |
$screen = get_current_screen(); | |
$editPostScreen = ($screen->parent_base == 'edit' && $screen->post_type == 'post') ? true : false; | |
$justPublished = (isset($_GET['message']) && $_GET['message'] == '6') ? true : false; | |
if ($editPostScreen && $justPublished) { | |
$class = 'notice notice-info'; |