Articles of database

Why having more than 10 clauses in WP_Query results in some outputs being dropped?

I don’t want to have image IDs in the source code of the posts, so I fetch them using the_content filter – the auxiliary function that does the query is as below. It works fine when I get up to 10 or 11 IDs, and if there are more IDs, they won’t appear in the […]

Best/Correct way to add an option to a category

I’m currently writing my first plugin, which will let the site admin/editor use a different image as a background/header for each post/page, and I would also like to have defaults for each category. Here is where I’m not sure how to proceed: If for each post/page the image (which is an attachment, so is just […]

update_user_meta() does not work

I asked a question yesterday, but I realised that the code was not correct and it was my bad, so I refactored everything. I have a form with two fields which when user submits and takes a quiz test, gets registered and his scores saved to user meta data table. My user gets created, but […]

Connect to another WP install and grab post based on custom field

This is the set up: Two separate wordpress installs on two separate domains (not multi-site) This is what I want to do Query the posts from database one based on custom field and display them on the other WordPress install This is what I have done: Created a metabox in the WP 1 install for […]

Storing data for a wordpress plugin

I am writing a plugin that needs to store data for a day (everyday). The data is retrieved from a CSV file. I will be retrieving three columns of financial data (Fund ID, Fund Description and Price) from the CSV files. The Fund ID and Description will be text and the price will obviously be […]

Replace dynamically content in a custom database table when a custom post is created

I use a third party plugin that saves events locations addresses as a custom locations post type in a separate table – wp_em_locations. Because events are created by multiple authors, they write sometimes differently the name of the same town, using different languages. How can I filter dynamically that names when the post is created […]

INSERT in table row fatal error

I just discovered this wonderful message board 🙂 Hopefully someone can help me with a WordPress issue I can’t figure out.. I added a hook to my plugin file to insert the post id of the immediate posts I publish, in a table named “post_votes” – used to keep track of up & down votes […]

How to make multi site with single Database?

I have a website with 10,000 Posts. Now I want to make more website with those posts. But requirement is: When I will update any post, all website post will be updated. When creating a new post, it will be published on all website. Every website settings will be different like Post permalink will be […]

WordPress Scheduled Event Request Blocking

This is a question about WordPress architecture, that I wasn’t able to fully understand by reading WordPress documentation. I have a scheduled event that can take more than 1 minute to finish because it’s a heavy stored procedure that create a few caches on my database. As far as I know, scheduled events in WordPress […]

WordPress and MySQL: trying to print data using PHP from user_meta custom field data

I have some custom user_meta fields in my MySQL database. The data is stored in my DB as follows: the meta_key is called “paypal_user” and the info is stored in the meta_value column as: O:11:”Paypal_User”:9:{s:8:”duration”;s:1:”1″;s:13:”duration_type”;s:1:”y”;s:6:”amount”;s:2:”30″;s:8:”currency”;s:3:”GBP”;s:13:”last_pay_date”;s:10:”2011-02-12″;s:11:”expire_date”;s:10:”2012-02-12″;s:12:”account_type”;s:7:”premium”;s:10:”status_str”;s:27:”Last payment was successful”;s:12:”payment_type”;s:12:”subscription”;} I need to print the “expire date” information on a webpage, as well as user_id and some […]