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
1736           } else {
1737                /**
1738                 * Filters the list of post query fields used by the given XML-RPC method.
1739                 *
1740                 * @since 3.4.0
1741                 *
1742                 * @param array  $fields Array of post fields. Default array contains 'post', 'terms', and 'custom_fields'.
1743                 * @param string $method Method name.
1744                 */
1745                $fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPost' );
1746           }
1747
1748           if ( ! $user = $this->login( $username, $password ) )
1749                return $this->error;
1750
1751           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
1752           do_action( 'xmlrpc_call', 'wp.getPost' );
1753
1754           $post = get_post( $post_id, ARRAY_A );
 
Line Code
1792
1793           $username = $args[1];
1794           $password = $args[2];
1795           $filter   = isset( $args[3] ) ? $args[3] : array();
1796
1797           if ( isset( $args[4] ) ) {
1798                $fields = $args[4];
1799           } else {
1800                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
1801                $fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPosts' );
1802           }
1803
1804           if ( ! $user = $this->login( $username, $password ) )
1805                return $this->error;
1806
1807           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
1808           do_action( 'xmlrpc_call', 'wp.getPosts' );
1809
1810           $query = array();