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
* | |
* Display the admin notices | |
* Based off of ??? | |
*/ | |
function pt_import_notices() { | |
global $gpt_log; | |
if (!empty($gpt_log)) { | |
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
/* | |
* determines if the specified membership level exists for the current user | |
* returns 0 (level does not match user) or 1 (level matched user) | |
*accepts string level name | |
*/ | |
function pp_get_level($culevel){ | |
//get the current user | |
$current_user = wp_get_current_user(); | |
//get the users 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
//list terms in a given taxonomy [ppshowtax='' orderby='name' 'style=' ' show_count = '' pad_counts = ' ' hierarchical = ' ' hide_empty= ' ' title_li='View Lessons' title_li=''] | |
function pp_show_taxs($atts){ | |
extract( shortcode_atts( array( | |
'taxonomy' => 'category', | |
'orderby' => 'name', | |
'style' => 'list', | |
'show_count' => 0, // 1 for yes, 0 for no | |
'pad_counts' => 0, // 1 for yes, 0 for no | |
'hierarchical' => 1, // 1 for yes, 0 for no |
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
/* | |
Per Post Custom CSS | |
This bit of code will add a meta box to the bottom | |
of every post and page content editor. In that box | |
you can enter your CSS styling declarations and that | |
specific CSS style will ONLY be loaded on that individual | |
page or post. | |
*/ | |
add_action('admin_menu', 'bb_custom_css_hooks'); | |
add_action('save_post', 'bb_save_custom_css'); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^([^/]+)/$ $1.php | |
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ |
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 | |
$path = "http://mydomain.com/myfiles"; //Set this to where files are located; | |
if ($handle = opendir('.')) { | |
while (false !== ($entry = readdir($handle))) { | |
if ($entry != "." && $entry != "..") { | |
$fullentry = $path.'/'.$entry; | |
echo "<a href='".$fullentry."'>".$entry."</a><br />"; | |
} | |
} | |
closedir($handle); |
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 ( is_admin() ) | |
return; | |
if ( ! class_exists( 'ExtensionNoTitleLayout' ) ) { | |
class ExtensionNoTitleLayout { | |
function ExtensionNoTitleLayout() { | |
it_classes_load( 'it-file-utility.php' ); | |
$this->_base_url = ITFileUtility::get_url_from_file( dirname( __FILE__ ) ); | |
add_action( 'builder_layout_engine_render', array( &$this, 'change_render_content' ), 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
.awac-wrapper{ | |
border:1px solid #333; | |
background:#f3f3f7; | |
margin-bottom:1em; | |
padding:.8em | |
} | |
.awac{ | |
margin-bottom:.8em | |
} | |
.awac .gform_wrapper .gform_footer{ |
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
function cleanstring(dirty){ | |
var smartchr = [ "’","‘","“","”","–","—","…", " ", '„', '‚' , '«','»', '‹', '›']; | |
var correctchr = ["'", "'", '"', '"', '-', '-', '...', '', '"', "'", '"', '"', "'", "'"]; | |
var thestring = dirty; | |
var regex; | |
for (var i = 0; i < smartchr.length; i++) { | |
regex = new RegExp(smartchr[i], "g"); | |
thestring = thestring.replace(regex, correctchr[i]); | |
} |
OlderNewer