Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct for-attribute, move secret-input down #100

Merged
merged 6 commits into from Feb 4, 2017
Merged

Conversation

websupporter
Copy link
Contributor

Solves #99

@websupporter
Copy link
Contributor Author

get rid of the input-field. its useless. add a filter instead.

@websupporter
Copy link
Contributor Author

put two filter in the get_secret-methods instead. more useful.

antispam_bee.php Outdated
* @param int $post_id The post ID.
*/
return apply_filters(
'get_secret_id_for_post',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefix is missing here.

antispam_bee.php Outdated
* @param int $post_id The post ID.
*/
return apply_filters(
'ab_get_secret_for_post',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add name in the filter?

@schlessera schlessera added this to the 2.7.0 milestone Feb 4, 2017
@websupporter
Copy link
Contributor Author

refactored get_secret_for_post() => get_secret_name_for_post()
added an esc_attr()
filter naming fixed


// Hidden field check
if ( empty($hidden_field) && ! empty($plugin_field) ) {
$_POST['comment'] = $plugin_field;
unset( $_POST[ self::get_secret_for_post( $post_id ) ] );
unset( $_POST[ self::get_secret_name_for_post( $post_id ) ] );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be unset( $plugin_field )?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could unset this too. But I think the general idea here is more get rid of the extra $_POST-field after the data has been transfered to $_POST['comment']

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nevermind, I misread the code.

@schlessera schlessera merged commit d822c3c into master Feb 4, 2017
@websupporter websupporter deleted the issue-99 branch February 5, 2017 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants