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 Name | |
* | |
* @param bool|string $foo | |
* | |
*/ |
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(document).ready(function() { | |
}); |
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
/* | |
===========================================*/ |
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 | |
/** Tested 3.0 | |
* Text Page. | |
* This is all the logic for the Text page. | |
*/ | |
class TextPage extends 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 | |
/** Important: When adding a second form to a website the second ModalAdmin extention would not function until I added it's | |
* Tested: 3.0 | |
* name into the same $managed_models array as the first. I was then able to take it out and have it work on it's own. | |
* ContactPage.php | |
* This is all the logic for the Contact page. | |
*/ | |
class ContactPage extends 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
class HomePage extends Page | |
{ | |
//Add static db array. This controls new databse fields added to this page type. | |
//These new columns will auto migrate to the db when running dev/build "flush=1" from the browser | |
static $db = array( | |
'HomeHeroTitle' => 'Varchar(100)', | |
'HomeHeroContent' => 'HTMLVarchar(1000)' | |
); | |
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 | |
/** Partners.php | |
* Partners Page. | |
* This is all the logic for the Partners page. | |
*/ | |
class PartnersPage extends Page | |
{ | |
//Set relationship | |
public static $has_many = array( |
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 | |
$args = array( 'post_type' => 'product', 'posts_per_page' => -1 ); | |
$loop = new WP_Query( $args ); | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
the_title(); | |
the_content(); |
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
//Add a single upload field to upload one image. | |
static $has_one = array( | |
'BackgroundImage' => 'Image' | |
); | |
$fields->addFieldToTab('Root.Main', new UploadField('BackgroundImage', 'Background Image'), 'Content'); |
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
$(document).ready(function(){ | |
$('form input:text, form textarea').each(function(){ | |
$.data(this, 'default', this.value); | |
}).focus(function(){ | |
if ($.data(this, 'default') == this.value) { | |
this.value = ''; | |
} | |
}).blur(function(){ | |
if (this.value === '') { | |
this.value = $.data(this, 'default'); |
OlderNewer