call_user_func_array() errors after migrating site with InstantWP
The issue was actually with the database. I had to bring it down and install again and it worked out. Thanks for the help from everyone.
The issue was actually with the database. I had to bring it down and install again and it worked out. Thanks for the help from everyone.
The wp_list_comments() function uses the HTML comment list class Walker_Comment by default: A single comment is then displayed with the Walker_Comment::comment() method (#source). If the comment format is HTML5 then the Walker_Comment::html5_comment() is used instead (#source). The pingbacks are rendered with the Walker_Comment::ping() method (#source).
Your code is incorrect in some subtle ways but to get why we first need to get back to what is a nonce in wordpress and what does it protect against. A Nonce by the common definition is a number used only once and it is meant to fight replay attacks. In a replay attack … Read more
Personally I’d do it the same way, since it seems to be the only point where you can examine user input and validate it. Also, heavily borrowing from code sample in this excellent article: function wpPartValidate_settings( $input ) { if ( check_admin_referer( ‘wpPart_nonce_field’, ‘wpPart_nonce_verify_adm’ ) ) { // Create our array for storing the validated … Read more
I had the same problem, and here what works for me: function journal_check_cats_callback() { $options = get_option(‘journal_theme_blog_2_col’); $pag = journal_theme_blog_2_col; $_cats = get_terms( ‘category’ ); $html=””; foreach ($_cats as $term) { $checked = in_array($term->term_id, $options) ? ‘checked=”checked”‘ : ”; $html .= sprintf( ‘<input type=”checkbox” id=”%1$s[%2$s]” name=”%1$s[]” value=”%2$s” %3$s />’, $pag, $term->term_id, $checked ); $html .= … Read more
That’s pretty simple, just use your website home url 🙂 After that, just fire an action when the page is loaded via POST HTTP method and hook with a callback. add_action( ‘wp_loaded’, function() { if ( $_SERVER[‘REQUEST_METHOD’] === ‘POST’ ) { // fire the custom action do_action(‘onchangeapi’, new PostListener($_POST)); } } ); And now the … Read more
Do not use different callbacks, use the the sixth parameter for add_settings_field() instead. That is an array, and you can pass any data to the callback here. Example: foreach( $theOptions as $k => $v ) { add_settings_field( $k, $v, ‘my_callback’, $the_options, $the_group, array ( ‘special’ => $k ) ); } function my_callback( $args ) { … Read more
wp_send_json_error( ‘Error: Invalid data!’ ) Will echoes a JSON string: {“success”:false,”data”:”Error: Invalid data!”} The nice thing about wp_send_json_error() is, the parameter could also be a WP_Error object. As opposed to wp_send_json_success( ‘Everything okay.’ ) which echoes this JSON string: {“success”:true,”data”:”Everything okay.”} Both rely internally on wp_send_json() to echo the JSON data properly and die() afterwards. … Read more
$post_id = wp_insert_post( $arg ); #returns post ID $permalink = get_permalink( $post_id ); #returns the permalink Codex: http://codex.wordpress.org/Function_Reference/wp_insert_post
I’ve created a reduced test case that demonstrates that what you want to do is achievable: add_action( ‘rest_api_init’, function() { register_rest_route( ‘wpse/343039’, ‘route’, [ ‘methods’ => [ ‘POST’ ], ‘permission_callback’ => function( WP_REST_Request $request ) { if ( ‘1’ == $request->get_param( ‘param’ ) ) { return true; } else { return false; } }, ‘callback’ … Read more