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
| //force user login, regardless of post type | |
| //UNLESS public is in the URL | |
| add_action('parse_request', 'rr_login_redirect'); | |
| function rr_login_redirect() { | |
| global $wp; | |
| if(stristr($wp->request,'public/') || stristr($wp->request,'/public')){} | |
| elseif (!is_user_logged_in()) { | |
| auth_redirect(); | |
| } | |
| } |
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 / Action to enable choosing private pages as parent pages | |
| */ | |
| function admin_private_parent_metabox($output) | |
| { | |
| global $post; | |
| $args = array( | |
| 'post_type' => $post->post_type, |
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 sortObjectBy(property) { | |
| var sortOrder = 1; | |
| if(property[0] === "-") { | |
| sortOrder = -1; | |
| property = property.substr(1, property.length - 1); | |
| } | |
| return function (a,b) { | |
| var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0; | |
| return result * sortOrder; | |
| } |
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 get_base_website_url() { | |
| if (!window.location.origin) | |
| return window.location.origin = window.location.protocol+"//"+window.location.host; | |
| else | |
| return window.location.origin; | |
| } |
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
| <table border="0" cellpadding="0" cellspacing="0" width="400"> | |
| <tbody> | |
| <tr height="10"> | |
| <td height="10" colspan="2"><hr style="height: 1px; border: 0; border-bottom: 1px dashed #ccc; padding: 0; margin: 12px 0 5px 0;" /></td> | |
| </tr> | |
| <tr style="vertical-align: middle;" height="100"> | |
| <td height="100" width="250" style="border-right: 1px dashed #ccc;"><strong>Seth Carstens</strong><br> | |
| Rapid Recovery<br> | |
| <a href="tel:8773727732">877-372-7732</a> office<br> | |
| <a href="tel:4802033753">480-203-3753</a> cell<br> |
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
| <apex:page standardStylesheets="false" showHeader="false" sidebar="false"> | |
| <apex:stylesheet value="{!URLFOR($Resource.WorkBookStyles, 'styles.css')}" /> |
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
| /* WE ARE ASSUMING JQUERY IS LOADED AND USING jQuery instead of $ */ | |
| jQuery(document).ready(function($) { | |
| window.setInterval(function(){ | |
| /// call your function here | |
| $('#increment').trigger('click'); | |
| }, 5000); | |
| }); | |
| /* |
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 | |
| //This example encrypts and decrypts a password | |
| //it is a good use case for a "php class file" because the __FILE__ is constant for the key | |
| //*additional security can be added by storing or defining a unique key per website | |
| //using __FILE__ exmaple for class files | |
| $pass = 'samplepassword123!'; | |
| echo 'Password: '.$pass.'<br />'; | |
| $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, sha1(basename(__FILE__), TRUE), $pass, MCRYPT_MODE_ECB); | |
| echo 'Encrypted Pass: '.$encrypted.'<br />'; |
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 | |
| //apparently no need for this... page-SLUG.php matches subpage slugs, | |
| //only need this function if subpage slug conflicts occur | |
| //Add this code to you themes functions.php file, or some other file. | |
| //Next create your child page lets says "domain.com/resources/faq" | |
| //Finally, create the php template page following the naming schema: | |
| //page-PARENTSLUG-child-CHILDSLUG.php -> page-resources-child-faq.php | |
| add_filter( 'page_template', 'enable_child_page_templates' ); | |
| function enable_child_page_templates( $page_template ){ |
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
| jQuery('#file_category').val(4); jQuery('#file_languages\\[\\]').val('en'); jQuery('#file_requirements\\[\\]').val('pdfread');jQuery('#updatefile').submit(); |