Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
qstudio committed Nov 27, 2020
1 parent c6f7511 commit b668cd7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
12 changes: 12 additions & 0 deletions library/context/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ public static function get( $args = null ){
}


/**
* Full object callback
*
* @since 4.1.0
*/
public static function data( $args = null ){

return [ 'data' => \willow\get\post::data( $args ) ];

}



/**
* Render WP_Query
Expand Down
42 changes: 42 additions & 0 deletions library/get/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,48 @@ public static function content( $args = null ){
}


/**
* Get Post object data to render
*
* @since 1.6.2
* @return Array
*/
public static function data( $args = null ){

// sanity ##
if (
is_null( $args )
|| ! is_array( $args )
){

h::log( 'e:>Error in pased args' );

return false;

}

// to make this more generic, we will get the current wp_post, if this is not passed ##
if (
! isset( $args['config']['post'] )
|| ! ( $args['config']['post'] instanceof \WP_Post )
){

$post = get\post::object();

} else {

$post = $args['config']['post'];

}

// h::log( $post );

// return post object to Willow ##
return $post;

}



/**
* Returns the permalink for a page based on the incoming slug.
Expand Down
5 changes: 4 additions & 1 deletion library/render/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ public static function prepare(){
|| ! is_array( self::$fields )
) {

/// log ##
// h::log( self::$fields );

// log ##
h::log( self::$args['task'].'~>e:>Error in $fields array' );

// kick out ##
return false;

}
Expand Down

0 comments on commit b668cd7

Please sign in to comment.