{"id":100,"date":"2017-08-15T10:39:42","date_gmt":"2017-08-15T10:39:42","guid":{"rendered":"http:\/\/www.ilonaferenc.co.uk\/playground\/?p=100"},"modified":"2017-08-15T10:39:42","modified_gmt":"2017-08-15T10:39:42","slug":"redirect-to-custom-user-dashboard-after-logging-in-with-oneall-wordpress-plugin","status":"publish","type":"post","link":"https:\/\/www.ilonaferenc.co.uk\/playground\/redirect-to-custom-user-dashboard-after-logging-in-with-oneall-wordpress-plugin\/","title":{"rendered":"Redirect to custom user dashboard after logging in with OneAll WordPress plugin"},"content":{"rendered":"<style>.gist table { margin-bottom: 0; }<\/style>\n<div style=\"tab-size: 8\" id=\"gist74608738\" class=\"gist\">\n<div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container\">\n<div id=\"file-if-functions-php\" class=\"file my-2\">\n<div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-hack  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"if-functions.php content, created by IlonaF on 10:27AM on August 15, 2017.\"\n    ><\/p>\n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n<p>  <template class=\"js-file-alert-template\"><\/p>\n<div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n    <span><br \/>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br \/>\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a><br \/>\n    <\/span><\/p>\n<div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters<br \/>\n<\/a>\n<\/div>\n<\/div>\n<p><\/template><br \/>\n<template class=\"js-line-alert-template\"><br \/>\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\"><br \/>\n    <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n<\/span><\/template><\/p>\n<table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"if-functions.php\">\n<tr>\n<td id=\"file-if-functions-php-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n<td id=\"file-if-functions-php-LC1\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\"><span class=\"pl-c\">\/*<\/span> Change redirect URL for OnaAll Social Login <span class=\"pl-c\">*\/<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td id=\"file-if-functions-php-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n<td id=\"file-if-functions-php-LC2\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">function<\/span> <span class=\"pl-en\">if_login_registration_redirect_filter<\/span> (<span class=\"pl-smi\">$url<\/span>, <span class=\"pl-smi\">$user_data<\/span>){<\/td>\n<\/tr>\n<tr>\n<td id=\"file-if-functions-php-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n<td id=\"file-if-functions-php-LC3\" class=\"blob-code blob-code-inner js-file-line\">  <span class=\"pl-smi\">$student_name<\/span> <span class=\"pl-k\">=<\/span> <span class=\"pl-en\">get_the_author_meta<\/span>( <span class=\"pl-s\"><span class=\"pl-pds\">&#39;<\/span>user_nicename<span class=\"pl-pds\">&#39;<\/span><\/span>, <span class=\"pl-smi\">$user_data<\/span><span class=\"pl-k\">-&gt;<\/span><span class=\"pl-smi\">id<\/span> );<\/td>\n<\/tr>\n<tr>\n<td id=\"file-if-functions-php-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n<td id=\"file-if-functions-php-LC4\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-smi\">$redirection_url<\/span> <span class=\"pl-k\">=<\/span> <span class=\"pl-en\">get_site_url<\/span>() <span class=\"pl-k\">.<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">&#39;<\/span>\/author\/<span class=\"pl-pds\">&#39;<\/span><\/span> <span class=\"pl-k\">.<\/span> <span class=\"pl-smi\">$student_name<\/span>;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-if-functions-php-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n<td id=\"file-if-functions-php-LC5\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">return<\/span> <span class=\"pl-smi\">$redirection_url<\/span>;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-if-functions-php-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n<td id=\"file-if-functions-php-LC6\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-if-functions-php-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n<td id=\"file-if-functions-php-LC7\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-en\">add_filter<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">&#39;<\/span>oa_social_login_filter_registration_redirect_url<span class=\"pl-pds\">&#39;<\/span><\/span>, <span class=\"pl-s\"><span class=\"pl-pds\">&#39;<\/span>if_login_registration_redirect_filter<span class=\"pl-pds\">&#39;<\/span><\/span>, <span class=\"pl-c1\">10<\/span>, <span class=\"pl-c1\">2<\/span>);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-if-functions-php-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n<td id=\"file-if-functions-php-LC8\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-en\">add_filter<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">&#39;<\/span>oa_social_login_filter_login_redirect_url<span class=\"pl-pds\">&#39;<\/span><\/span>, <span class=\"pl-s\"><span class=\"pl-pds\">&#39;<\/span>if_login_registration_redirect_filter<span class=\"pl-pds\">&#39;<\/span><\/span>, <span class=\"pl-c1\">10<\/span>, <span class=\"pl-c1\">2<\/span>);<\/td>\n<\/tr>\n<\/table>\n<\/div><\/div>\n<\/p><\/div>\n<\/div><\/div>\n<div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/IlonaF\/320fbbdad59c3917cdbefa379285fb95\/raw\/f3965ed0731661da23f41f9deab695a8d6142db5\/if-functions.php\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a><br \/>\n        <a href=\"https:\/\/gist.github.com\/IlonaF\/320fbbdad59c3917cdbefa379285fb95#file-if-functions-php\" class=\"Link--inTextBlock\"><br \/>\n          if-functions.php<br \/>\n        <\/a><br \/>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters \/* Change redirect URL for OnaAll Social Login *\/ function if_login_registration_redirect_filter ($url, $user_data){ $student_name &hellip; <a href=\"https:\/\/www.ilonaferenc.co.uk\/playground\/redirect-to-custom-user-dashboard-after-logging-in-with-oneall-wordpress-plugin\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Redirect to custom user dashboard after logging in with OneAll WordPress plugin&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[7,6,4,3,5],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7klL5-1C","_links":{"self":[{"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/posts\/100"}],"collection":[{"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":1,"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/posts\/100\/revisions\/101"}],"wp:attachment":[{"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ilonaferenc.co.uk\/playground\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}