Permalink
Browse files

Update functions.php

I added $return to post_add_new_link:

	yourls_do_action( 'post_add_new_link', $url, $keyword, $title, $return );

This makes it easier to add conditional actions.  For example, I might want to do certain actions depending on whether $return['status'] is 'success' or 'fail'.
  • Loading branch information...
adigitalife committed Oct 26, 2018
1 parent e3475da commit 7f32924dac52f1488309415957f3fb3e2fa277c9
Showing with 1 addition and 1 deletion.
  1. +1 −1 includes/functions.php
View
@@ -309,7 +309,7 @@ function yourls_add_new_link( $url, $keyword = '', $title = '' ) {
$return['shorturl'] = YOURLS_SITE .'/'. $url_exists->keyword;
}
yourls_do_action( 'post_add_new_link', $url, $keyword, $title );
yourls_do_action( 'post_add_new_link', $url, $keyword, $title, $return );
$return['statusCode'] = 200; // regardless of result, this is still a valid request
return yourls_apply_filter( 'add_new_link', $return, $url, $keyword, $title );

0 comments on commit 7f32924

Please sign in to comment.