Problem with images URL after filter applying

<?php $string = ‘Sentence 1. Sentence 2? Sentence 3! Sentence 4… Sentence 5… Sentence 6! Sentence 7. Sentence 8. Sentence 9… Sentence 10… Sentence 11. ‘; $sentences_per_paragraph = 3; // settings $pattern = ‘~(?<=[.?!…])\s+~’; // some punctuation and trailing space(s) $sentences_array = preg_split($pattern, $string, -1, PREG_SPLIT_NO_EMPTY); // get sentences into array $sentences_count = count($sentences_array); // … Read more

Get Attachment Category Name

The answer was found here: http://www.wprecipes.com/how-to-display-category-name-without-link For my purposes, I needed to define the category function and then call it by name-only inside the php echo: <?php $category = get_the_category($attachment->ID); echo ‘html goes here’; echo ”.$category[0]->cat_name.’; ?> Additionally, to help eliminate space or punctuation in the category name, it can display the slug instead: <?php … Read more

Email Exists ERROR into Ajax registration form

Why are you making work hard for yourself? wp_create_user already checks if the email/login exists, which is also why your code is “failing” – $user_id will already be a WP_Error, so your elseif ( is_wp_error( $newerrors ) ) never fires. All you need is: $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email, $capa ); if ( is_wp_error( … Read more

Adding a section in line at the end of the main navigation menu in php

https://developer.wordpress.org/reference/hooks/wp_nav_menu_menu-slug_items/ function my_nav_menu_primary_navigation($items, $args) { $items .= ‘<li>Hello :D</li>’; return $items; } add_filter( “wp_nav_menu_{MENU SLUG}_items”, “my_nav_menu_primary_navigation”, 10, 2 ); find {MENU SLUG} EDIT: The “wp_nav_menu_menu-slug_item” filter runs at the end near the end of wp_nav_menu, $ items is a string containing the HTML extructura the menu and $ args are the arguments that you passed … Read more

Redirects based on a JSON file

The way I do it. Note there may be a more straightforward way. Step 1 Add a custom query_varlike this to record the redirect from/to variables function my_custom_query_vars($vars){ //this allows you to store custom variables with rediect_from and rediect_to in the url $vars[] = ‘redirect_from’; $vars[] = ‘redirect_to’; return $vars; } add_filter( ‘query_vars’, ‘my_custom_query_vars’ ); … Read more

“options.php” not found

Like @LupuAndrei said, we lack of details, especially the code where you call you form from. But I suspect, again like @LupuAndrei said, you might not be calling the settings_fields, do_settings_fields or do_settings_sections correctly. On the function where you build your form, try something like this <form method=”post” action=”options.php”> <table class=”form-table”> <?php settings_fields( ‘animated-settings-group’ ); … Read more