there is no single function you can use but you can create your own something like:
function get_all_post_fields($post_id){
$p['standard'] = get_post($post_id, ARRAY_A);
$p['meta'] = get_post_custom($post_id);
return $p;
}
then once you have this in your functions.php file you can use it:
$fields_all = get_all_post_fields($ID);
Update:
If you have just the title then i have a simple function i use a lot to get the post id by the title:
function get_post_ID_by_title($page_title) {
global $wpdb;
$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type="post"", $page_title ));
if ( $post_id )
return post_id;
return false;
}
usage: $post_id = get_post_ID_by_title("this is my title");
Related Posts:
- Fatal error: Call to undefined function mysql_connect()
- Query both first_name and last_name from wp_usermeta at the same time
- How to validate WordPress generated password in DB using PHP?
- How to get the list of WooCommerce product image of a certain category from database?
- Custom query to get post names beginning with a digit
- How to add query vars with paginated URLs?
- Changing user_nicename
- WordPress will not operate correctly
- How to Join two tables from separate databases within WordPress
- tag search using WP_Query
- simple wordpress ajax plugin not working when not logged in
- Install will not load: PHP does not have MYSQL installed
- Insert post without actions/hooks
- Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- the_author_meta not working
- Import 10,000 Users into WordPress WITH a specific ID for each user
- if statement on database query
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- How to get the post_id from postmeta
- Sortable admin column for one meta key with three possible meta values
- WordPress Ajax Custom Query – High CPU LOAD
- AJAX in WordPress, sending coords data to MySQL and show after into map
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- Styling images coming from another blog
- register_activation_hook isn’t adding table to DB
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- How to convert objects into arrays
- Ajax $wpdb not returning table data
- Converting MYSQL to WordPress $WPDB
- Is there a way to get 3+ dimensional array from a single MySql command
- Custom Plugin For Converting CSV To MySQL
- Checking for new message using AJAX and PHP. Server overload?
- Can’t get wp_insert_post to work
- I want to select the from values from database in WordPress? [closed]
- mysql query from wordpress page using custom table
- User management system similar to wordpress one?
- Importing Geo data into wordpress database
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- How to check if a meta value has already been assigned to any user?
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- wp query foreach deleting record returning only first or last item
- inserting a post from an extern php file but post content doesn’t show on wp site
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- $wpdb->wp_users returning empty value for
- Custom array from a query only write the last row of the query
- php include not working in custom page
- Force Users To Relogin
- email alert for product availability
- Basic wpdb update question
- A $_POST should occur when submit form but is not?
- Custom route and query
- Pull MySQL data from multiple tables and merge into 1 PHP array
- How do I prepare strings for insertions as values into a MySQL table?
- Using CFDB7 vs Custom MySQL Database [closed]
- add category to posts with tag wordpress
- How can I Use 2 databases with one WordPress install
- Why won’t this wpdb get_results query return results?
- Adding data to custom wordpress database table
- select a single val though a table in wordpress
- populate select options from extra mysql table data
- Removal of all posts content in bulk, keeping the posts itself
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- How to store checkbox data for individual users?
- WordPress low speed after migrating to new host
- AWS Lightsail WordPress – connect to database on instance using mysqli
- call to undefined function mysql_connect
- Usermeta data unserialize, extract and display in table in WordPress
- I can’t separate the array by commas
- Using wpdb to connect to a different database is not working
- How to edit content in WordPress and the Polylang – plugin? – with demosite
- How can i limit the number of posts to the most recent 6 in my query?
- Change upload URL by mime type
- Insert data from form to database
- (Who to follow) Twitter widget
- Prepared DB Query from _POST array
- How can I display a query in a page?
- How to properly send many mysql queries via php and what happens with ajax requests after they are sent?
- Conditional statement within WP SQL query
- Passed variable gets undefined variable error on insert on next page
- How to set up an auto delete post?
- WordPress upload images not displaying
- two wordpress sites, two themes, one database, same content
- how to check for wordpress Query errors
- Insert double entry in DB
- Splitting One Big WordPress Site into Multiple Small Sites
- MySQL database migration to WordPress
- Custom query_posts() parameter
- MySQL update text field with ‘
- Query Concatenation
- Display total count of products in orders of a specific order status
- How to get a database field value from a WordPress table? [closed]
- Execute multiple PHP Snippets causes error?
- Error resetting database index using ALTER TABLE in $wpdb->query
- what to do after instlling cyberpanel on VPS
- Can’t insert into a database wordpress
- Updates applied to staging WordPress site affecting production even with different databases
- How to return count number from a wordpress database
- Trying to GET data with ajax from database and show in fullcalendar