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
$entity_type = 'entity_type'; | |
$entity = entity_create($entity_type, array( | |
'title' => 'Lorem Ipsum', | |
'type'=>'bunble_type', | |
// 'field_custom_field' => array( | |
// 'und' => array('value') | |
// ), | |
) | |
); | |
$wrapper = entity_metadata_wrapper($entity_type, $entity); |
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
$args_not_clean = arg(); //Get Current Args | |
$args = array(); | |
foreach ($args_not_clean as $value) { | |
$args[] = check_plain($value); //sanitize URL arguments | |
} |
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
Naming Convention: | |
[theme/site] Feature - TYPE | |
[theme/site] Feature - Content - TYPE | |
[theme/site] Feature - ECK - TYPE | |
Field Bases | |
Definitions for all fields on the site. All of them. Leave Out ('taxonomy_forums','comment_body','body') | |
Field Groups | |
Definitions for all field groups on the site. All of them. |
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
$parent = get_post(wpcf_pr_post_get_belongs('child-id','parent')); |
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 | |
types_child_posts($post_type, $args) | |
/* | |
$post_type – a string with the name of the child items to load. Since a parent may have children of different types, this argument is required. | |
$arg – optional, with additional query arguments. | |
For example, to load ‘room’ child items: | |
*/ | |
$child_posts = types_child_posts('room'); | |
foreach ($child_posts as $child_post) { | |
echo $child_post->post_title; |
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
$child_posts = types_child_posts('appearance'); | |
foreach ($child_posts as $child_post) { | |
$band_id = wpcf_pr_post_get_belongs($child_post->ID, 'band'); | |
$band = get_post($band_id); | |
echo $band->post_title; | |
} |
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 | |
switch ($i): | |
case 0: | |
echo "i equals 0"; | |
break; | |
default: | |
//code here | |
endswitch; | |
?> |
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 new dBug ( $post );?> |
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 | |
//get_children() | |
$args = array( | |
// number of post to retrieve | |
'numberposts' => -1, | |
/* | |
Pass the ID of a post or Page to get its children. | |
Pass 0 to get attachments without parent. | |
Pass null to get any child regardless of parent. | |
*/ |
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: inline-block; | |
*display: inline; | |
*zoom: 1; |
NewerOlder