Below, you’ll find a detailed guide on how to add the Miniorange Login Openid Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Miniorange Login Openid Plugin shortcodes not to show or not to work correctly.
Before starting, here is an overview of the Miniorange Login Openid Plugin and the shortcodes it provides:
"WordPress Social Login and Register is a versatile plugin enabling users to sign in or register via Discord, Google, Twitter, LinkedIn. Enhance user experience with seamless social logins."
- [miniorange_social_login]
- [miniorange_social_sharing]
- [miniorange_social_sharing_vertical]
- [miniorange_social_custom_fields]
- [miniorange_social_comments]
- [miniorange_social_login_logout]
Miniorange Login Openid [miniorange_social_login] Shortcode
The miniorange_social_login shortcode is a function that integrates social login into your WordPress site. It calls the mo_get_output function, which generates the HTML for the login form.
Shortcode: [miniorange_social_login]
Examples and Usage
Basic example – The shortcode is used to output the miniorange social login form on any page or post by simply inserting it into the content.
[miniorange_social_login /]
PHP Function Code
In case you have difficulties debugging what causing issues with [miniorange_social_login]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'miniorange_social_login', array( $this, 'mo_get_output' ) );
Shortcode PHP function:
function mo_get_output( $atts ) {
$miniorange_widget = new mo_openid_login_wid();
$html = $miniorange_widget->openidloginFormShortCode( $atts );
return $html;
}
Code file location:
miniorange-login-openid/miniorange-login-openid/miniorange_openid_sso_settings.php
Miniorange Login Openid [miniorange_social_sharing] Shortcode
The miniorange_social_sharing shortcode is a tool that enables social sharing on your WordPress site. This shortcode pulls the title of your post and prepares it for sharing. The PHP function mo_get_sharing_output retrieves the content of the post, strips any tags and shortcodes, and encodes the title for URL sharing.
Shortcode: [miniorange_social_sharing]
Examples and Usage
Basic example – Using the ‘miniorange_social_sharing’ shortcode to share the current post.
[miniorange_social_sharing]
PHP Function Code
In case you have difficulties debugging what causing issues with [miniorange_social_sharing]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'miniorange_social_sharing', array( $this, 'mo_get_sharing_output' ) );
Shortcode PHP function:
function mo_get_sharing_output( $atts ) {
$title = '';
global $post;
if ( isset( $post ) ) {
$content = get_the_content();
$title = str_replace( '+', '%20', urlencode( $post->post_title ) );
$content = strip_shortcodes( strip_tags( get_the_content() ) );
}
$html = mo_openid_share_shortcode( $atts, $title );
return $html;
}
Code file location:
miniorange-login-openid/miniorange-login-openid/miniorange_openid_sso_settings.php
Miniorange Login Openid [miniorange_social_sharing_vertical] Shortcode
The miniorange_social_sharing_vertical shortcode is designed for the MiniOrange Login OpenID plugin. It generates a vertical social sharing bar in WordPress posts. The PHP function mo_get_vertical_sharing_output extracts the post title and content, then calls the mo_openid_vertical_share_shortcode function to render the sharing bar.
Shortcode: [miniorange_social_sharing_vertical]
Examples and Usage
Basic example – The basic usage of the ‘miniorange_social_sharing_vertical’ shortcode is simply inserting the shortcode into your post or page. This will display the social sharing buttons vertically on your WordPress site.
[miniorange_social_sharing_vertical /]
PHP Function Code
In case you have difficulties debugging what causing issues with [miniorange_social_sharing_vertical]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'miniorange_social_sharing_vertical', array( $this, 'mo_get_vertical_sharing_output' ) );
Shortcode PHP function:
function mo_get_vertical_sharing_output( $atts ) {
$title = '';
global $post;
if ( isset( $post ) ) {
$content = get_the_content();
$title = str_replace( '+', '%20', urlencode( $post->post_title ) );
$content = strip_shortcodes( strip_tags( get_the_content() ) );
}
$html = mo_openid_vertical_share_shortcode( $atts, $title );
return $html;
}
Code file location:
miniorange-login-openid/miniorange-login-openid/miniorange_openid_sso_settings.php
Miniorange Login Openid [miniorange_social_custom_fields] Shortcode
The miniorange_social_custom_fields shortcode retrieves and sanitizes user data from a form submission. If the user is not logged in, it captures their details from the form fields. If logged in, it returns empty values.
Shortcode: [miniorange_social_custom_fields]
Examples and Usage
Basic example – A shortcode that displays custom user fields when the user is not logged in.
[miniorange_social_custom_fields]
PHP Function Code
In case you have difficulties debugging what causing issues with [miniorange_social_custom_fields]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'miniorange_social_custom_fields', array( $this, 'mo_get_custom_output' ) );
Shortcode PHP function:
function mo_get_custom_output() {
$title = '';
global $post;
if ( isset( $post ) ) {
$content = get_the_content();
$title = str_replace( '+', '%20', urlencode( $post->post_title ) );
$content = strip_shortcodes( strip_tags( get_the_content() ) );
}
$curr_user = get_current_user_id();
if ( $curr_user == 0 ) {
$last_name = isset($_POST['last_name']) ? sanitize_text_field($_POST['last_name']) : ""; // phpcs:ignore
$first_name = isset($_POST['first_name']) ? sanitize_text_field($_POST['first_name']) : ""; // phpcs:ignore
$user_full_name = isset($_POST['user_full_name']) ? sanitize_text_field($_POST['user_full_name']) : ""; // phpcs:ignore
$user_url = isset($_POST['user_url']) ? sanitize_text_field($_POST['user_url']) : ""; // phpcs:ignore
$call = isset($_POST['call']) ? sanitize_text_field($_POST['call']) : ""; // phpcs:ignore
$user_profile_url = isset($_POST['user_profile_url']) ? sanitize_text_field($_POST['user_profile_url']) : ""; // phpcs:ignore
$user_picture = isset($_POST['user_picture']) ? sanitize_text_field($_POST['user_picture']) : ""; // phpcs:ignore
$username = isset($_POST['username']) ? sanitize_text_field($_POST['username']) : ""; // phpcs:ignore
$user_email = isset($_POST['user_email']) ? sanitize_text_field($_POST['user_email']) : ""; // phpcs:ignore
$random_password = isset($_POST['random_password']) ? sanitize_text_field($_POST['random_password']) : ""; // phpcs:ignore
$decrypted_app_name = isset($_POST['decrypted_app_name']) ? sanitize_text_field($_POST['decrypted_app_name']) : ""; // phpcs:ignore
$decrypted_user_id = isset($_POST['decrypted_user_id']) ? sanitize_text_field($_POST['decrypted_user_id']) : ""; // phpcs:ignore
$social_app_name = isset($_POST['social_app_name']) ? sanitize_text_field($_POST['social_app_name']) : ""; // phpcs:ignore
$social_user_id = isset($_POST['social_user_id']) ? sanitize_text_field($_POST['social_user_id']) : ""; // phpcs:ignore
} else {
$last_name = '';
$first_name = '';
$user_full_name = '';
$user_url = '';
$call = '';
$user_profile_url = '';
$user_picture = '';
$username = '';
$user_email = '';
$random_password = '';
$decrypted_app_name = '';
$decrypted_user_id = '';
$social_app_name = '';
$social_user_id = '';
}
$html = apply_filters( 'customization_form', $last_name, $first_name, $user_full_name, $user_url, $call, $user_profile_url, $user_picture, $username, $user_email, $random_password, $decrypted_app_name, $decrypted_user_id, $social_app_name, $social_user_id );
return $html;
}
Code file location:
miniorange-login-openid/miniorange-login-openid/miniorange_openid_sso_settings.php
Miniorange Login Openid [miniorange_social_comments] Shortcode
The miniorange-login-openid plugin shortcode is a handy tool for integrating social comments into your WordPress site. It enables users to comment using their social media accounts, enhancing user interaction. This shortcode calls the mo_get_comments_output function, which returns social comments in the form of HTML. This simplifies the process of adding social comments to your posts.
Shortcode: [miniorange_social_comments]
Examples and Usage
Basic example – Displaying social comments using the miniorange-login-openid plugin.
[miniorange_social_comments /]
PHP Function Code
In case you have difficulties debugging what causing issues with [miniorange_social_comments]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'miniorange_social_comments', array( $this, 'mo_get_comments_output' ) );
Shortcode PHP function:
function mo_get_comments_output( $atts ) {
$html = mo_openid_comments_shortcode();
return $html;
}
Code file location:
miniorange-login-openid/miniorange-login-openid/miniorange_openid_sso_settings.php
Miniorange Login Openid [miniorange_social_login_logout] Shortcode
The miniorange_social_login_logout shortcode is a function that checks if a user is logged in. If true, it displays a ‘Log Out’ button. This button, when clicked, logs the user out, redirecting them to the current page.
Shortcode: [miniorange_social_login_logout]
Examples and Usage
Basic example – A simple usage of the ‘miniorange_social_login_logout’ shortcode to display a logout button if a user is logged in.
[miniorange_social_login_logout /]
PHP Function Code
In case you have difficulties debugging what causing issues with [miniorange_social_login_logout]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'miniorange_social_login_logout', array( $this, 'mo_get_logout' ) );
Shortcode PHP function:
function mo_get_logout() {
ob_start();
if ( is_user_logged_in() ) :
?>
<div><a role="button" href="<?php echo esc_url( wp_logout_url( get_permalink() ) ); ?>">Log Out</a></div>
<?php
endif;
return ob_get_clean();
}
Code file location:
miniorange-login-openid/miniorange-login-openid/miniorange_openid_sso_settings.php
Conclusion
Now that you’ve learned how to embed the Miniorange Login Openid Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply