Add custom objects/entities to WordPress

I think what you want is to create what WorpPress calls “Custom Post Types”. Please have a look at the Post Type page in the Codex that explains what Post Types are and how to create custom ones. Basically, here is the code to create the Object custom post type : add_action( ‘init’, ‘create_post_type’ ); … Read more

Problem with serialized arrays in custom meta

See my comment on your question above. I just realized that if you’re ending up with those special characters in the database, most likely you’re not sanitizing the data before saving it into the database. Try running htmlentities() over all the values that you’re saving into that serialized array, and see if you end up … Read more

How to access custom order item meta data from a meta key in WooCommerce?

There is at least 2 ways to get custom order item meta data from a defined meta key: 1) Since WooCommerce 3 – Using WC_Data method get_meta() 2) The older way – Using wc_get_order_item_meta() WooCommerce function So your hooked function bs_order_lead_time_data() code will be: add_action( ‘woocommerce_my_account_my_orders_column_order-lead-time’, ‘bs_order_lead_time_data’ ); function bs_order_lead_time_data( $order ) { foreach ( … Read more

Custom search: by post data and post metadata?

The built-in WP search looks only a Posts’/Pages’ Title and Content, not thru other elements like Custom Fields and the content of Shortcodes. There’s a number of plugs that will search Custom Fields: http://wordpress.org/extend/plugins/wp-custom-fields-search/ http://wordpress.org/extend/plugins/search-everything/ http://wordpress.org/extend/plugins/relevanssi/ There also a filter apply_filters_ref_array() that “allows plugins to contextually add/remove/modify the search section of the database query.” FYI, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)