Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: xmlrpc_default_post_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
1554           } else {
1555                /**
1556                 * Filter the list of post query fields used by the given XML-RPC method.
1557                 *
1558                 * @since 3.4.0
1559                 *
1560                 * @param array $fields  Array of post fields.
1561                 * @param string $method Method name.
1562                 */
1563                $fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPost' );
1564           }
1565
1566           if ( ! $user = $this->login( $username, $password ) )
1567                return $this->error;
1568
1569           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
1570           do_action( 'xmlrpc_call', 'wp.getPost' );
1571
1572           $post = get_post( $post_id, ARRAY_A );
 
Line Code
1613           $blog_id    = (int) $args[0];
1614           $username   = $args[1];
1615           $password   = $args[2];
1616           $filter     = isset( $args[3] ) ? $args[3] : array();
1617
1618           if ( isset( $args[4] ) ) {
1619                $fields = $args[4];
1620           } else {
1621                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
1622                $fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPosts' );
1623           }
1624
1625           if ( ! $user = $this->login( $username, $password ) )
1626                return $this->error;
1627
1628           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
1629           do_action( 'xmlrpc_call', 'wp.getPosts' );
1630
1631           $query = array();