Lines:
1 to 100 of 128
<?php // (C) Copyright Bobbing Wide 2013-2017 /* function bw_new() – Implement [bw_new] shortcode to allow the creation of a new post through a simple form */ /* function bw_new__help() – Help hook for [bw_new] shortcode */ /* function bw_new__syntax() – Syntax hook for [bw_new] shortcode */ /* function bw_new_post_form_id() – Return a unique new post form ID */ if ( !function_exists( "bw_issue_message" ) ) { /* function bw_issue_message() – Issue a message for a particular field */ } if ( !function_exists( "bw_query_messages" ) ) { /* function bw_query_messages() – Return number of messages to display */ } if ( !function_exists( "bw_display_message" ) ) { /* function bw_display_message() – Display a message */ } if ( !function_exists( "bw_display_messages" ) ) { /* function bw_display_messages() – Display the messages */ } /* function bw_obtain_field() – Obtain and trim a field */ /* function bw_validate_function_title() – Validate a "post_title" field */ /* function bw_validate_function_content() – Validate a "post_content" field */ /* function _bw_field_validation_required() – Validate a #required field as having a value */ /* function bw_field_validation() – Perform field validation/sanitization based on #field_type and $field name */ /* function bw_validate_function_fields() – Validate the custom fields for the Add new form */ /* function _bw_validate_functions() – Return the array of functions for validating particular fields in a form */ /* function bw_call_validate_function() – Call the function to validate a field */ /* function bw_validate_fields() – Validate the fields in the form */ /* function bw_validate_form_as_required() – Validate the Add new form to match what’s expected */ /* function bw_determine_post_status() – Determine post_status for new post */ /* function bw_insert_post() – Insert a post of the specified post type with custom fields set from the validated fields */ /* function bw_set_validated_field() – Set a post field if validated */ /* function bw_spam_check() – Perform an Akismet spam check against the submitted form */ /* function bw_get_edit_post_link() – Get an edit post link for use in emails */ /* function bw_notify_author_email() – Send an email to the post author informing them of a new entry to review */ /* function bw_return_fields() – Return the fields to be printed in the email body */ /* function _bw_process_new_post_form_oik() – Process a new post form submission */ /* function bw_default_required_marker() – Return a required field marker */ /* function _bw_form_required_field() – Set the field to required if that’s the case. */ /* function _bw_show_new_post_fields() – Display the required fields in the form */ /** * Notes about implementing filters for [bw_new] shortcode, using $post_type = "post" as an example * * You only need to implement the "oik_add_new_${post_type}" filter if you don't want the default processing which is "true" * e.g. * add_filter( "oik_add_new_post", "__return_false" ); * * The default format for the Add new form is provided by bw_add_new_format_default() * * add_filter( "oik_add_new_format_post", "bw_add_new_format_default" ); * * The default fields for the Add new form are provided by bw_add_new_fields_defaults( $post_type ) * The $post_type is passed as the second parameter * This code is WRONG, as the function only expects one parameter * * add_filter( "oik_add_new_fields_post", "bw_add_new_fields_defaults", 10, 2 ); * add_filter( "oik_set_spam_fields_post", "bw_set_spam_fields" ); */ /* function bw_add_new_format_default() – Return the default format for the "Add new" form */ /* function bw_add_new_fields_defaults() – Return all the fields to be used in an "Add new" form */ /* function bw_set_spam_fields() – Set default values for fields for spam checking */ /* function bw_call_form_function() – Invoke the function to display the field in a form */ /* function bw_form_function_title() – Display the post title field */View on GitHub