How to add placeholder in wp_editor?

Your approach to replace <textarea with <textarea placeholder=” is correct. Just wp_editor function does not returns html code, which you can change. Function just echoes output. You can capture this output with ob_start and ob_get_clean, as described here: $wpEditorPlaceholder=”My Placeholder”; ob_start(); wp_editor( $project_description , ‘project_description’, array( ‘wpautop’ => true, ‘media_buttons’ => false, ‘textarea_name’ => ‘project_description’, … Read more

Why is my drop down empty

I’d guess you may have figured this out by now. Here’s my answer anyway. You say the API returns an array whose object items have label and value properties but if I try that same request I get an array whose object items have name and id properties (as you would expect when you specify … Read more

Calling a PHP function from a menu item

There’s a few things to consider here. 1) You should always first check for a third-party plugin like WPML. If, for whatever reason, WPML stops working or gets deactivated, assuming it’s there could result in a fatal error. function directByLang() { if( defined( ‘ICL_SITEPRESS_VERSION’ ) ) { $current_lang = apply_filters(‘wpml_current_language’, NULL); if ($current_lang == ‘en’) … Read more

How to include Font Awesome icons into ‘menu_icon’ from register_post_type() function – wp admin?

I haven’t found any solution to entirely convert dashicons- class automatically generated into fas fa-…. Having always used fa-solid or fa-regular I didn’t know you could shorten with fas and far. My mistake So I bypassed the style font-family:dashicons; adding: div.wp-menu-image.dashicons-before[class*=”fa”]::before { font-family: “Font Awesome 6 Free” !important; } In theory [class*=”fa”] include fa, fas, … Read more