WordPress - Taxonomy MetaData RETRIEVE - php

I am using https://github.com/bainternet/My-Meta-Box to create MetaData in my taxonomy "group"
How do I retrieve that data? As of right now I have each group ID, but i have no idea how to retrieve the MetaData.

Just figured it out. Unfortunately, https://github.com/bainternet/My-Meta-Box Uses the WP_Options table in the database, not the Meta table, like it should.
Here is how to get the information.
<?$meta = get_option('tax_meta_'.$category->term_id)?>

Related

Edit wordpress menĂº from mysql query

I'm trying to insert / modify / delete items from a Wordpress menu from a MYSQL query in a separate WordPress file.
Does anyone know how wordpress menus work at the database level?
They're nothing else than a default postype, specifically: nav_menu_item.
So like the rest of the postypes they are in the post table or wp_posts if you use that prefix.
As all the rest of postypes their meta values are stored in postmeta/wp_postsmeta with the corresponding id.

Implement custom search by term name(s) in wordpress

I have implemented normal search functionality in simple pages using php and MySQL where I get result rows by mysqli_fetch_array. There I could have any numbers of variable with AND or OR relationship and it will retrieve results from the db.
Now I am trying to do this in WordPress.
I have seen solutions where one uses WP_query to search by term names. How do I achieve this AND and OR variables in my search query.
For example, my query is like select all post title where term name like 'search keyword' AND term slug like 'hi'.
I have created a view terms_and_posts table from merging terms and posts tables using taxonomy relationship, with columns custom term name, custom term slug, post title, post content, post status, and post type.
Do I need a merged table or it can be achieved by modifying WP_Query?
I do not want to resort to using plugins as I am very new to WordPress, and I prefer not to use plugins as long as I can help it.

Wordpress Subscriptions in laravel (corcel)

I have 2 projects, one in Wordpress, and the other one in Laravel 4.2.
Recently i had to merge both projects into one Laravel 4.2 App using jgrossi/corcel. This was my only option.
Everything works fantastic! I can even post directly into Wordpress without logging into Wordpress to get posts, comments, etc.
But there is something I can't figure out. Wordpress is using Jetpack for subscribers. The laravel app needs a field to add more subscribers. I have very little experience in Wordpress.
Is it possible to add subscribers from outside Wordpress directly into the database? If not, is there a way to use a Jetpack plugin outside of Wordpress?
Yes you can add new users in database with subscribers role.
Wordpress stores the users data in wp_users table and its meta info in wp_usermeta. So follow the following steps
Add a new entry in wp_users table. As a sample here is entry from my wp_users table. You can submit values for these attributes using your normal laravel form with post request.
Add its related data in wp_usermeta table. Here you need to set two key value attributes against user_id of newly inserted record.
meta_key = wp_capabilites and meta_value = a:1:{s:10:"subscriber";b:1;}. As you can note the meta_value for wp_capabilities is in serialzed form.
meta_key = show_admin_bar_front and meta_value = true.
So you added a new user with subscriber role.

creating slug in wordpress while inserting data from csv

I have created a plugin to upload the csv to wordpress. what i want to know is how to create the slug of the title while inserting it into wp_posts.
Current i am using normal mysql query to insert the data.
Any help?
Thanks
The post_name column in wp_posts contains the slug. For generating the slug itself use sanitize_title

how wordpress can un-slug a title

i still , don't understand , how wordpress can understand what is this url refer to :
www.mysite.com/about-me/
they are using no identifier
if they using slug functions so how they can retain story information or in other word , how they change back the slugged title to select from database
It processes the "pretty" URL and queries the database with that data. Of course slugs are checked to be unique on creation. Details are in the function url_to_postid() in the file wp-includes/rewrite.php.
If you want to directly obtain the id from the slug you can query the database:
SELECT ID
FROM wp_posts
WHERE post_name = '$slug'
you might need to check wp_posts which is the default name, but it depends on the installation.
This is just a guess:
My guess is that they store the titles in a database, and make sure every title is unique. That way, they can do a look-up by title and know which item is coupled to that.

Categories