Hot answers tagged hooks
2
Text its just plain text, just as its saved in your db.
Wordpress changes line breaks with paragraphs with the function wpautop, through the filter the_content and the_excerpt.
If you need to remove the wpautop behavior, you can remove the filter by doing this in your theme's functions.php:
remove_filter( 'the_content', 'wpautop' );
remove_filter( ...
2
Use some kind of a Controller and combine the calls to both classes in one callback for each action. The controller should be responsible for the real assignation of business logic to an event (action), not some code outside of your classes.
The basic point is: Your plugin controller should not alter data, only Models should do that.
The following example ...
1
There's the edit_user_profile_update and personal_options_update actions that runs after a user is updated, with access to the user object. There's also a variable update_{$meta_type}_meta action that runs when meta of type user is updated.
1
Use the action from update_post_meta():
do_action(
"updated_{$meta_type}_meta", // example: updated_post_meta
$meta_id,
$object_id, // post ID
$meta_key, // 'view'
$_meta_value // view count
);
Something like this should work (not tested):
add_action( 'update_post_meta', 'badge_check', 10, 4 );
function badge_check( $meta_id, ...
Only top voted, non community-wiki answers of a minimum length are eligible