i am engaged on a web site that makes use of the bigcommerce plugin for wordpress:
https://github.com/bigcommerce/bigcommerce-for-wordpress
and that i’d wish to make a customized view of a buyer’s orders, that lists the names of each product that buyer has ordered. the default order historical past web page supplied by the plugin principally does this, however in an order with a number of merchandise will record one of many merchandise adopted by “and # different merchandise(s)”.
and i used to be considering i might then get the data i want from the order element web page, through the use of every particular person order element web page’s url and passing it to utilizing get_page
:
https://developer.wordpress.org/reference/features/get_page_by_path/
nonetheless, i do not assume the urls are literally referring to particular pages, however somewhat querying one thing from bigcommerce by way of the url. i do not know the right way to verify this, however i can not seem to get information again utilizing the get_page
perform.
my different thought is the order is a customized publish sort, however utilizing code discovered right here:
https://wordpress.stackexchange.com/a/95906
/**
* Verify if a publish is a customized publish sort.
* @param blended $publish Publish object or ID
* @return boolean
*/
perform is_custom_post_type( $publish = NULL )
{
$all_custom_post_types = get_post_types( array ( '_builtin' => FALSE ) );
// there are not any customized publish sorts
if ( empty ( $all_custom_post_types ) )
return FALSE;
$custom_types = array_keys( $all_custom_post_types );
$current_post_type = get_post_type( $publish );
// couldn't detect present sort
if ( ! $current_post_type )
return FALSE;
return in_array( $current_post_type, $custom_types );
}
Utilization:
if ( is_custom_post_type() )
print 'This can be a customized publish sort!';
these element pages don’t return as customized publish sorts.
any assistance on that is a lot appreciated! thanks!!!