Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: xmlrpc_default_posttype_fields

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
3689           } else {
3690                /**
3691                 * Filter the default query fields used by the given XML-RPC method.
3692                 *
3693                 * @since 3.4.0
3694                 *
3695                 * @param array  $fields An array of post type query fields for the given method.
3696                 * @param string $method The method name.
3697                 */
3698                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
3699           }
3700
3701           if ( !$user = $this->login( $username, $password ) )
3702                return $this->error;
3703
3704           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
3705           do_action( 'xmlrpc_call', 'wp.getPostType' );
3706
3707           if( ! post_type_exists( $post_type_name ) )
 
Line Code
3738           $blog_id            = (int) $args[0];
3739           $username           = $args[1];
3740           $password           = $args[2];
3741           $filter             = isset( $args[3] ) ? $args[3] : array( 'public' => true );
3742
3743           if ( isset( $args[4] ) ) {
3744                $fields = $args[4];
3745           } else {
3746                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
3747                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
3748           }
3749
3750           if ( ! $user = $this->login( $username, $password ) )
3751                return $this->error;
3752
3753           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
3754           do_action( 'xmlrpc_call', 'wp.getPostTypes' );
3755
3756           $post_types = get_post_types( $filter, 'objects' );