Built in admin ajax hooks?

WordPress core is something where you cannot create your own hooks. Hooks in WordPress are created with these apply_filters apply_filters_ref_array apply_filters_deprecated do_action do_action_ref_array do_action_deprecated The only thing you can do is to register your function to certain WordPress core hook. But where are these hooks? You may expect these hooks in a function called activate_plugin. … Read more

Hook before inserting user into database [duplicate]

If you examine the wp_insert_user() function, you can see there are a myriad of filters and actions that are called throughout the process. The first is a filter called pre_user_login on the username. Line 1304 of wp-includes/user.php: $user_login = apply_filters(‘pre_user_login’, $user_login); You could hook onto that and throw your own custom error message. Edit: The … Read more

Wrap all post images inside a div element

Try using PHP’s regular expression find/replace function—preg_replace()—in a filter on the the_content hook. function breezer_addDivToImage( $content ) { // A regular expression of what to look for. $pattern = ‘/(<img([^>]*)>)/i’; // What to replace it with. $1 refers to the content in the first ‘capture group’, in parentheses above $replacement=”<div class=”myphoto”>$1</div>”; // run preg_replace() on … Read more

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