Dhimas Kirana
Forum Replies Created
-
Forum: Plugins
In reply to: [Force Login] Bypassing only specific REST endpointJust add it to make it clearer and other users can use this method.
/** * Bypass Force Login to allow for REST API exceptions. * * @param mixed $result WP_Error if authentication error, null if authentication * method wasn't used, true if authentication succeeded. */ function my_forcelogin_bypass_rest_api( $result ) { // Skip if request is authenticated if (!empty($result)) { return $result; } if ($_SERVER['REQUEST_URI'] == '/wp-json/wp/v2/posts') { return true; } return $result; } add_filter( 'rest_authentication_errors', 'my_forcelogin_bypass_rest_api', 20 );Forum: Plugins
In reply to: [WP Hotelier] Problem Available RoomHi @benitolopez
thank you for your explanation.Forum: Developing with WordPress
In reply to: how to integrate an external API in wordpressHi, maybe you can use wp_remote_request() function. reference: wp_remote_request()
Forum: Developing with WordPress
In reply to: Need help with WP enqueuingFirst, I think you should give a unique name to bootstrap.css. Don’t use stylesheets as names to avoid you forgetting to register another stylesheet with the same name.
wp_register_style('bootstrap-css' , get_template_directory_uri() . '/css/bootstrap.min.css' , array(), false, 'all'); wp_enqueue_style('bootstrap-css');Second, for style.css you just to enqueque it. Use get_stylesheet_uri() instead.
wp_enqueue_style( 'style', get_stylesheet_uri() );Forum: Developing with WordPress
In reply to: Help in converting php into shortcodeI guess the shortcode will be placed on the page with GET request.
Ok, so maybe the code is like this. I don’t know where the $type array data came from, so make sure the $type array data passes to the function correctly.
add_shortcode( 'your_shortcode', 'your_shortcode_function' ); function your_shortcode_function() { if ($type == 'credit') { return 'Thank you for using your nedvil wallet.'; } if ($type == 'debit') { return 'Thank you for using your wallet.'; } }Forum: Developing with WordPress
In reply to: Help in converting php into shortcodeJust a simple code. You can modified with your code.
add_shortcode( 'your_shortcode', 'your_shortcode_function' ); function your_shortcode_function() { if (isset($_GET['type']) && $_GET['type'] == 'credit') { return 'Thank you for using your nedvil wallet.'; } if (isset($_GET['type']) && $_GET['type'] == 'debit') { return 'Thank you for using your wallet.'; } }place [your_shortcode] on your page.
access with get. example:
yourwebsite.com/your-page/?type=credit
yourwebsite.com/your-page/?type=debitForum: Developing with WordPress
In reply to: Add some code in a page (Autofilter)I think better use “Site-Specific WordPress Plugin” to run some code.
<?php /* Plugin Name: Site Plugin for example.com Description: Site specific code changes for example.com */ /* Start Adding Functions Below this Line */ add_filter('og_og_title_meta', 'my_og_og_title_meta'); function my_og_og_title_meta($title) { if ( is_home() ) { return '<meta property="og:title" content="WordPress Title" />'; } return $title; } /* Stop Adding Functions Below this Line */Save as your-site-plugin.php in /wp-content/plugins/
Then activate on Plugins.Forum: Developing with WordPress
In reply to: Add some code in a page (Autofilter)Maybe this thread helps you.. similar case:
https://ww.wp.xz.cn/support/topic/it-seems-that-it-doesnt-work-for-me-some-conflict-perhaps/Forum: Fixing WordPress
In reply to: Plugin to show last registered usersYou can use some function to show last registered users. Here’s the tutorial https://www.wpbeginner.com/wp-tutorials/how-to-display-recently-registered-users-in-wordpress/
I suggest you use shortcode for the function, so you can simply call the shortcode on the Text Widget or HTML Custom Widget. No need to place hard-code functions in template files.
Don’t forget to adjust the html output on the functions to make it similar with your template style.
hi @jesscga
I just updated my php version to 7.4.2 and the error is goneHi danielsdennis, i’m also get same thing..
Hi Jay,
That’s right. I will wait in the next update. 🙂
Thank you..
i’m not use AIOSEO again. Now, i use Yoast SEO..