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 | |
require_once( dirname( __FILE__ ) . '/wp-load.php' ); // get WP | |
$result = wp_remote_get( "https://fontawesome.com/cheatsheet" ); | |
$out = $result['body']; | |
$start = "window.__inline_data__ = "; // start here | |
$end = "</script>"; | |
$startsAt = strpos( $out, $start ) + strlen( $start ); | |
$endsAt = strpos( $out, $end, $startsAt ); |
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
[ | |
{ | |
"name": "Priority: Critical", | |
"color": "ff2222" | |
}, | |
{ | |
"name": "Priority: High", | |
"color": "FF7922" | |
}, | |
{ |
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
{"Newspaper_custom":{"geodir_wrapper_open_id":"","geodir_wrapper_open_class":"","geodir_wrapper_open_replace":"<div class='td-main-content-wrap td-container-wrap'> <div class='td-container '>","geodir_wrapper_close_replace":"<\/div><\/div>","geodir_wrapper_content_open_id":"","geodir_wrapper_content_open_class":"","geodir_wrapper_content_open_replace":"<div class='td-pb-row'><div class='td-pb-span8 td-main-content' role='main'>","geodir_wrapper_content_close_replace":"","geodir_article_open_id":"","geodir_article_open_class":"","geodir_article_open_replace":"","geodir_article_close_replace":"","geodir_sidebar_right_open_id":"","geodir_sidebar_right_open_class":"","geodir_sidebar_right_open_replace":"<div class='td-pb-span4 td-main-sidebar' role='complementary'>","geodir_sidebar_right_close_replace":"<\/div><\/div>","geodir_sidebar_left_open_id":"","geodir_sidebar_left_open_class":"","geodir_sidebar_left_open_replace":"<div class='td-pb-span4 td-main-sidebar' role='complementary'>","geodir_sidebar_left_close_r |
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 | |
// Set error reporting to display all errors and notices | |
error_reporting(E_ALL); | |
// Start a session | |
session_start(); | |
// Check for the existence of a known session variable | |
if (isset($_SESSION['test_value'])) { | |
_e('Test value (should increase by 1 on each page refresh): '); echo $_SESSION['test_value']; | |
$_SESSION['test_value']++; | |
} else { |
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 // <-- you probably dont need this line | |
add_action('geodir_after_save_listing','_my_update_comment_settings_on_save',10,2); | |
function _my_update_comment_settings_on_save($last_post_id, $request_info){ | |
global $wpdb; | |
if(isset($request_info['geodir_allow_comments']) && $request_info['geodir_allow_comments']=='1'){ | |
$wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET comment_status = 'open' WHERE ID = %d", $last_post_id)); | |
}elseif(isset($request_info['geodir_allow_comments']) && $request_info['geodir_allow_comments']=='0'){ | |
$wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET comment_status = 'closed' WHERE ID = %d", $last_post_id)); |
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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: EDD Upgrade Notice | |
* Plugin URI: http://ayecode.io/ | |
* Description: Add upgrade notice support to EDD Software Licencing. | |
* Version: 1.0.0 | |
* Author: Stiofan O'Connor | |
* Author URI: http://ayecode.io/ | |
* License: GPL-2.0+ |
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 // <- You probably don't need this line | |
/** | |
* Show WP Easy Updates required admin notification. | |
*/ | |
if(is_admin()){ | |
if (!function_exists('ayecode_show_update_plugin_requirement')) {//only load the update file if needed | |
function ayecode_show_update_plugin_requirement() { | |
if ( !defined( 'WP_EASY_UPDATES_ACTIVE' ) ) { | |
?> |
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
{"Flatsome_custom":{"geodir_wrapper_open_id":"","geodir_wrapper_open_class":"","geodir_wrapper_open_replace":"<div class=\"page-wrapper page-right-sidebar\"><div class=\"row\">","geodir_wrapper_close_replace":"<\/div><\/div>","geodir_wrapper_content_open_id":"","geodir_wrapper_content_open_class":"","geodir_wrapper_content_open_replace":"<div id=\"content\" class=\"large-9 left col col-divided\" role=\"main\"><div class=\"page-inner\">","geodir_wrapper_content_close_replace":"<\/div><\/div>","geodir_article_open_id":"","geodir_article_open_class":"","geodir_article_open_replace":"","geodir_article_close_replace":"","geodir_sidebar_right_open_id":"","geodir_sidebar_right_open_class":"","geodir_sidebar_right_open_replace":"<div class=\"large-3 col\"><div id=\"secondary\" class=\"widget-area \" role=\"complementary\">","geodir_sidebar_right_close_replace":"<\/div><\/div>","geodir_sidebar_left_open_id":"","geodir_sidebar_left_open_class":"","geodir_sidebar_left_open_replace":"<div class=\"large-3 col\"><div id=\" |
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_filter('geodir_dashboard_links','_my_dashboard_links',10); | |
function _my_dashboard_links($dash_links){ | |
$dash_links .= "<li><a href='#'>My Custom Link</a></li>"; | |
return $dash_links; | |
} |
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 | |
// replace 'associations' with your html var | |
add_filter('geodir_custom_field_output_multiselect_var_geodir_associations','_my_association_outputs',10,3); | |
function _my_association_outputs($html,$location,$cf){ | |
// check we have the post value | |
global $post; | |
if (!empty($post->{$cf['htmlvar_name']})): |
NewerOlder