Change color of active link to navigation menu

Consider changing the CSS to: .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__label { color #365ABA !important; } Please note, this only works on the Πρότζεκτς and Γνωρίστε μας menu items. As these are the only pages that get the current-menu-item class when on their respective pages. For the other menu items, you may need to look at re-adding the menu … Read more

Changing src URL on page id

Instead of saying “its not working” it would be more informative to describe what’s happening. You should first put the iFrame URL into a variable ratther than writing the iFram HTML code twice: <?php $page_id = get_queried_object_id(); // default iFrame src $iFrameSrc = “URL A”; if($page_id == 5232) { $iFrameSrc = “URL B”; } ?> … Read more

Buddypress Redirection on Users with Subscriber Role

If a subscriber on your BuddyPress site doesn’t have access to a specific page, it’s likely due to membership level restrictions set up on the page, meaning only users with a specific subscription plan (like a “premium” or “pro” level) can access it; you might need to check your BuddyPress settings to adjust access based … Read more

How can I process a form submission from an HTTP POST request?

you can use admin-post.php to process the form. you can set the form like that : <form action=”<?= htmlspecialchars(admin_url(“admin-post.php?action=MY_PLUGIN__my_action”))?>” method=”POST” > <button name=”send”>go</button> </form> and then you link the code with that : add_action(“admin_init”, function () { if ( !isset($_GET[“action”]) || (“MY_PLUGIN__my_action” !== $_GET[“action”]) ) { return; } /* */ // debug var_export($_POST); exit(); /* … Read more

How to delete Full Size options from post Add Media?

function remove_extra_image_sizes() { foreach ( get_intermediate_image_sizes() as $size ) { if ( in_array( $size, array( ‘full’ ) ) ) { remove_image_size( $size ); } } } add_action(‘init’, ‘remove_extra_image_sizes’); Ref: remove_image_size() function I think this will help you.

Inserting more than one array into same row

foreach loops over a single variable. Here you have two, so using foreach is not the right method. Or you’d have to add a $i index inside the loop to get the second variable. But there’s a simpler way: $total = count($_POST[‘file_name’]); for($i = 0; $i < $total; $i++) { $file_name = $_POST[‘file_name’][$i]; $file = … Read more

refresh media library item

I just solve this using this: // Ensure wp.media.frame exists before modifying if (wp.media && wp.media.frame) { var library = wp.media.frame.state().get(‘library’); // Set custom filter (your_key) and refresh media items library.props.set({ your_key: selectedValue }); } And create custom WordPress pre_get_posts like this: public function pre_get_posts_filter( $query ) { $request_data = isset( $_REQUEST[ ‘query’ ] ) … Read more