How can I add a Description column to the media library browser screen?

I think I’m getting hung up on this line: echo substr(strrchr($meta[‘attachment_content’], “https://wordpress.stackexchange.com/” ), 1); Yep! Try this version of the description_value function: function description_value($column_name, $id) { echo get_the_content($id); } Media items are posts of the type attachment. The description is stored in the post_content property of the post object. You can see all of the … Read more

Loops in category description

What you want to do is to group fruits by color. In WordPress term appropriate mechanism for that is taxonomy (categories and tags are examples of taxonomy). I would create a custom taxonomy “fruit color” where terms would be individual colors and assigned to fruits. Then your display logic would be to: retrieve all fruit … Read more

Pass $item->description to start_lvl

// Get menu description as global variable function add_menu_description( $item_output, $item, $depth, $args ) { global $description; $description = $item->post_content; return $item_output; } add_filter( ‘walker_nav_menu_start_el’, ‘add_menu_description’, 10, 4); // Submenu walker to add image class submenu_walker extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) { if(0 == $depth) { global … Read more

WPML – Auto Duplicate Post Issue

The problem is that you are unsetting the default language form $langs array, so when you loop over $langs to make the duplicates, the default language is never included. This may be the cause of your problem (nothing to do with WordPress by the way). function wpml_duplicate_on_publish($post_id) { global $post, $sitepress, $iclTranslationManagement; // don’t save … Read more

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