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
alert(123); | |
document.write(456); |
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
body { | |
background: red; | |
} | |
body:after { | |
content: "css changed"; | |
position: absolute; | |
top: 20px; | |
left: 20px; |
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
<meta charset="utf-8"> | |
<title>SimpleNote Restorer</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
background-color: #f5f5f5; | |
color: #111; | |
font-size: 14px; | |
} | |
li { |
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 post connector for a post using PHP. | |
* | |
* This way it's possible to select a post connector for posts based on their ID, categories, tags, post type, and so on | |
* | |
* This function is using the filter simple_fields_get_selected_connector_for_post that is called when | |
* simple fields determines what connector it should use for each post. | |
* It passes the connector slug and the post object and you should return the slug of the conector that you want to use. |
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 | |
// if current page is password protected then kindly tell google (aka search engines) to not index the current page | |
function ep_noindex_password_protected_pages() { | |
global $wp_the_query; | |
if ( $wp_the_query->is_singular && post_password_required( $wp_the_query->get_queried_object ) ) { | |
wp_no_robots(); | |
} |
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 | |
// modify get_pages so we can add "exclude_password_protected=1" to exclude password protected | |
// pages from for example wp_list_pages | |
// if user has entered correct password then the page will be visible | |
function ep_exclude_password_protected_pages($pages, $r) { | |
if ( isset( $r["exclude_password_protected"] ) && $r["exclude_password_protected"] ) { | |
for ($i = 0; $i < sizeof($pages); $i++) { |
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 simple_fields_wp_api_json_prepare_post( $_post, $post, $fields ) { | |
// we dont't get the post id | |
$post_id = $_post["ID"]; | |
$field_values = simple_fields_get_all_fields_and_values_for_post($post_id); | |
$field_values_for_json = array( | |
"field_groups" => array() |
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 | |
simple_fields_register_field_group('date_field_group', | |
array ( | |
'name' => 'Test field group for date picker', | |
'fields' => array( | |
array( | |
'slug' => "my_date2_field_slug", | |
'name' => 'Test date selector', | |
'type' => 'date_v2', |
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 | |
// Read the original blog post here to understand what this is: | |
// http://simple-fields.com/2013/status-board-panel-to-show-wordpress-plugin-downloads/ | |
define('WP_USE_THEMES', false); | |
define("WP_CACHE", false); // i get 404 if enabled | |
require('../wordpress/wp-blog-header.php'); | |
class panic_dashboard_wp_plugin_stats { |
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 | |
// Loop through a wp query obj | |
$wp_query_obj = new wp_query('post_type=regions&posts_per_page=3&orderby=title&order=asc'); | |
with_posts($wp_query_obj, function($post, $arr_info) { | |
echo "<p>I am post number" . $arr_info["current_post"] . " of " . $arr_info["post_count"] " found post(s).</p>"; | |
echo "<p>My title is: " . get_the_title() . "</p>"; | |
echo "<p>And my slug is: " . $post->post_name . "</p>"; | |
}); | |
?> |