Version Description
2021-05-18 =
* Bugfix: Remove depreciative method jQuery.fn.load().
* Enhancement: Translations added for custom login messages.
* Enhancement: Added a filter loginpress_llms_lostpassword_url
to prevent the redirection of lost password to Lifter LMS's lost password page.
Download this release
Release Info
Developer | hiddenpearls |
Plugin | Custom Login Page Customizer | LoginPress |
Version | 1.5.3 |
Comparing to | |
See all releases |
Code changes from version 1.5.2 to 1.5.3
- custom.php +101 -75
- js/customizer-previewer.js +167 -165
- loginpress.php +2 -2
- readme.txt +7 -2
custom.php
CHANGED
@@ -29,21 +29,21 @@ class LoginPress_Entities {
|
|
29 |
*/
|
30 |
private function _hooks() {
|
31 |
|
32 |
-
add_filter( 'login_title',
|
33 |
add_filter( 'login_headerurl', array( $this, 'login_page_logo_url' ) );
|
34 |
if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
|
35 |
-
add_filter( 'login_headertitle',array( $this, 'login_page_logo_title' ) );
|
36 |
} else {
|
37 |
add_filter( 'login_headertext', array( $this, 'login_page_logo_title' ) );
|
38 |
}
|
39 |
-
add_filter( 'login_errors',
|
40 |
-
add_filter( 'login_message',
|
41 |
-
add_action( 'customize_register',
|
42 |
-
add_action( 'login_footer',
|
43 |
-
add_action( 'login_head',
|
44 |
-
add_action( 'init',
|
45 |
-
add_action( 'admin_menu',
|
46 |
-
add_filter( 'wp_login_errors',
|
47 |
|
48 |
/**
|
49 |
* This function enqueues scripts and styles in the Customizer.
|
@@ -1623,7 +1623,7 @@ class LoginPress_Entities {
|
|
1623 |
|
1624 |
if ( array_key_exists( 'login_copy_right_display', $this->loginpress_key ) && true == $this->loginpress_key['login_copy_right_display'] ) {
|
1625 |
|
1626 |
-
$footer_text = ( array_key_exists( 'login_footer_copy_right', $this->loginpress_key ) && ! empty( $this->loginpress_key['login_footer_copy_right'] ) ) ? $this->loginpress_key['login_footer_copy_right'] : sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress'), date("Y"), get_bloginfo('name') );
|
1627 |
|
1628 |
echo '<div class="copyRight">'. apply_filters( 'loginpress_footer_copyright', $footer_text ) .'</div>';
|
1629 |
}
|
@@ -1641,14 +1641,14 @@ class LoginPress_Entities {
|
|
1641 |
* Manage the Login Head
|
1642 |
*
|
1643 |
* @since 1.0.0
|
1644 |
-
* @version 1.
|
1645 |
* * * * * * * * * * * */
|
1646 |
public function login_page_custom_head() {
|
1647 |
|
1648 |
$loginpress_setting = get_option( 'loginpress_setting' );
|
1649 |
$lostpassword_url = isset( $loginpress_setting['lostpassword_url'] ) ? $loginpress_setting['lostpassword_url'] : 'off';
|
1650 |
|
1651 |
-
|
1652 |
add_filter( 'gettext', array( $this, 'change_username_label' ), 20, 3 );
|
1653 |
// add_filter( 'gettext', array( $this, 'change_password_label' ), 20, 3 );
|
1654 |
// Include CSS File in heared.
|
@@ -1664,17 +1664,31 @@ class LoginPress_Entities {
|
|
1664 |
if ( 'on' == $lostpassword_url ) {
|
1665 |
remove_filter( 'lostpassword_url', 'wc_lostpassword_url', 10 );
|
1666 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1667 |
}
|
1668 |
/**
|
1669 |
* Set Redirect Path of Logo
|
1670 |
*
|
1671 |
-
* @since
|
|
|
|
|
1672 |
* @return mixed
|
1673 |
* * * * * * * * * * * * * */
|
1674 |
public function login_page_logo_url() {
|
1675 |
|
1676 |
if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover'] ) ) {
|
1677 |
-
return $this->loginpress_key["customize_logo_hover"];
|
1678 |
} else {
|
1679 |
return home_url();
|
1680 |
}
|
@@ -1684,6 +1698,7 @@ class LoginPress_Entities {
|
|
1684 |
* Remove the filter login_errors from woocommerce login form.
|
1685 |
*
|
1686 |
* @since 1.0.16
|
|
|
1687 |
* @return errors
|
1688 |
* * * * * * * * * * * * */
|
1689 |
function loginpress_woo_login_errors( $validation_error, $arg1, $arg2 ) {
|
@@ -1696,13 +1711,15 @@ class LoginPress_Entities {
|
|
1696 |
/**
|
1697 |
* Set hover Title of Logo
|
1698 |
*
|
1699 |
-
* @since
|
|
|
|
|
1700 |
* @return mixed
|
1701 |
* * * * * * * * * * * * */
|
1702 |
public function login_page_logo_title() {
|
1703 |
|
1704 |
if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover_title', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover_title'] ) ) {
|
1705 |
-
return $this->loginpress_key["customize_logo_hover_title"];
|
1706 |
} else {
|
1707 |
return home_url();
|
1708 |
}
|
@@ -1714,6 +1731,7 @@ class LoginPress_Entities {
|
|
1714 |
* @param $error
|
1715 |
* @since 1.0.0
|
1716 |
* @version 1.2.5
|
|
|
1717 |
* @return string
|
1718 |
* * * * * * * * * * * * * * * * */
|
1719 |
public function login_error_messages($error) {
|
@@ -1775,13 +1793,14 @@ class LoginPress_Entities {
|
|
1775 |
* @param $text
|
1776 |
* @since 1.0.0
|
1777 |
* @version 1.0.21
|
|
|
1778 |
* @return mixed
|
1779 |
* * * * * * * * * * * * * * * * * * */
|
1780 |
public function change_lostpassword_message( $translated_text, $text, $domain ) {
|
1781 |
|
1782 |
if ( is_array( $this->loginpress_key ) && array_key_exists( 'login_footer_text', $this->loginpress_key ) && $text == 'Lost your password?' && 'default' == $domain && trim( $this->loginpress_key['login_footer_text'] ) ) {
|
1783 |
|
1784 |
-
return trim( $this->loginpress_key['login_footer_text'] );
|
1785 |
}
|
1786 |
|
1787 |
return $translated_text;
|
@@ -1791,9 +1810,11 @@ class LoginPress_Entities {
|
|
1791 |
* @param [type] $translated_text [description]
|
1792 |
* @param [type] $text [description]
|
1793 |
* @param [type] $domain [description]
|
1794 |
-
* @return string
|
1795 |
* @since 1.1.3
|
1796 |
* @version 1.1.7
|
|
|
|
|
|
|
1797 |
*/
|
1798 |
public function change_username_label( $translated_text, $text, $domain ){
|
1799 |
|
@@ -1811,19 +1832,19 @@ class LoginPress_Entities {
|
|
1811 |
return $translated_text;
|
1812 |
}
|
1813 |
|
1814 |
-
// If options
|
1815 |
if ( $loginpress_setting && $default === $text ) {
|
1816 |
|
1817 |
// Check if the option exists.
|
1818 |
-
|
1819 |
if ( 'username' == $login_order ) {
|
1820 |
$label = __( 'Username', 'loginpress' );
|
1821 |
} elseif ( 'email' == $login_order ) {
|
1822 |
$label = __( 'Email Address', 'loginpress' );
|
1823 |
} else {
|
1824 |
-
$label = 'Username or Email Address';
|
1825 |
}
|
1826 |
-
|
1827 |
} else {
|
1828 |
return $translated_text;
|
1829 |
}
|
@@ -1831,45 +1852,49 @@ class LoginPress_Entities {
|
|
1831 |
}
|
1832 |
return $translated_text;
|
1833 |
}
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
}
|
|
|
|
|
1867 |
|
1868 |
/**
|
1869 |
* Manage Welcome Messages
|
1870 |
*
|
1871 |
* @param $message
|
1872 |
* @since 1.0.0
|
|
|
|
|
1873 |
* @return string
|
1874 |
* * * * * * * * * * * * */
|
1875 |
public function change_welcome_message($message) {
|
@@ -1881,7 +1906,7 @@ class LoginPress_Entities {
|
|
1881 |
|
1882 |
if ( array_key_exists( 'logout_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['logout_message'] ) ) {
|
1883 |
|
1884 |
-
$loginpress_message = $this->loginpress_key['logout_message'];
|
1885 |
}
|
1886 |
}
|
1887 |
|
@@ -1890,7 +1915,7 @@ class LoginPress_Entities {
|
|
1890 |
|
1891 |
if ( array_key_exists( 'lostpwd_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['lostpwd_welcome_message'] ) ) {
|
1892 |
|
1893 |
-
$loginpress_message = $this->loginpress_key['lostpwd_welcome_message'];
|
1894 |
}
|
1895 |
}
|
1896 |
|
@@ -1898,7 +1923,7 @@ class LoginPress_Entities {
|
|
1898 |
|
1899 |
if ( array_key_exists( 'register_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['register_welcome_message'] ) ) {
|
1900 |
|
1901 |
-
$loginpress_message = $this->loginpress_key['register_welcome_message'];
|
1902 |
}
|
1903 |
}
|
1904 |
|
@@ -1923,11 +1948,10 @@ class LoginPress_Entities {
|
|
1923 |
else {
|
1924 |
if ( array_key_exists( 'welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['welcome_message'] ) ) {
|
1925 |
|
1926 |
-
$loginpress_message = $this->loginpress_key['welcome_message'];
|
1927 |
}
|
1928 |
}
|
1929 |
|
1930 |
-
|
1931 |
return ! empty( $loginpress_message ) ? "<p class='custom-message'>" . $loginpress_message. "</p>" : $message;
|
1932 |
}
|
1933 |
}
|
@@ -1935,15 +1959,17 @@ class LoginPress_Entities {
|
|
1935 |
/**
|
1936 |
* Set WordPress login page title.
|
1937 |
*
|
1938 |
-
* @since
|
|
|
|
|
1939 |
* @return string
|
1940 |
* * * * * * * * * * * * * * * * */
|
1941 |
public function login_page_title( $title ) {
|
1942 |
|
1943 |
if ( $this->loginpress_key && array_key_exists( 'customize_login_page_title', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_login_page_title'] ) ) {
|
1944 |
-
|
1945 |
} else {
|
1946 |
-
|
1947 |
}
|
1948 |
}
|
1949 |
|
@@ -1959,25 +1985,25 @@ class LoginPress_Entities {
|
|
1959 |
|
1960 |
if ( is_multisite() ) { // if subdirectories are used in multisite.
|
1961 |
|
1962 |
-
|
1963 |
$loginpress_page = $loginpress_obj->get_loginpress_page();
|
1964 |
|
1965 |
-
|
1966 |
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
|
1976 |
-
|
1977 |
|
1978 |
} else {
|
1979 |
|
1980 |
-
|
1981 |
}
|
1982 |
}
|
1983 |
}
|
29 |
*/
|
30 |
private function _hooks() {
|
31 |
|
32 |
+
add_filter( 'login_title', array( $this, 'login_page_title' ), 99);
|
33 |
add_filter( 'login_headerurl', array( $this, 'login_page_logo_url' ) );
|
34 |
if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
|
35 |
+
add_filter( 'login_headertitle', array( $this, 'login_page_logo_title' ) );
|
36 |
} else {
|
37 |
add_filter( 'login_headertext', array( $this, 'login_page_logo_title' ) );
|
38 |
}
|
39 |
+
add_filter( 'login_errors', array( $this, 'login_error_messages' ) );
|
40 |
+
add_filter( 'login_message', array( $this, 'change_welcome_message' ) );
|
41 |
+
add_action( 'customize_register', array( $this, 'customize_login_panel' ) );
|
42 |
+
add_action( 'login_footer', array( $this, 'login_page_custom_footer' ) );
|
43 |
+
add_action( 'login_head', array( $this, 'login_page_custom_head' ) );
|
44 |
+
add_action( 'init', array( $this, 'redirect_to_custom_page' ) );
|
45 |
+
add_action( 'admin_menu', array( $this, 'menu_url' ), 10 );
|
46 |
+
add_filter( 'wp_login_errors', array( $this, 'remove_error_messages_in_wp_customizer' ), 10, 2 );
|
47 |
|
48 |
/**
|
49 |
* This function enqueues scripts and styles in the Customizer.
|
1623 |
|
1624 |
if ( array_key_exists( 'login_copy_right_display', $this->loginpress_key ) && true == $this->loginpress_key['login_copy_right_display'] ) {
|
1625 |
|
1626 |
+
$footer_text = ( array_key_exists( 'login_footer_copy_right', $this->loginpress_key ) && ! empty( $this->loginpress_key['login_footer_copy_right'] ) ) ? __( $this->loginpress_key['login_footer_copy_right'], 'loginpress' ) : sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress'), date("Y"), get_bloginfo('name') );
|
1627 |
|
1628 |
echo '<div class="copyRight">'. apply_filters( 'loginpress_footer_copyright', $footer_text ) .'</div>';
|
1629 |
}
|
1641 |
* Manage the Login Head
|
1642 |
*
|
1643 |
* @since 1.0.0
|
1644 |
+
* @version 1.5.3
|
1645 |
* * * * * * * * * * * */
|
1646 |
public function login_page_custom_head() {
|
1647 |
|
1648 |
$loginpress_setting = get_option( 'loginpress_setting' );
|
1649 |
$lostpassword_url = isset( $loginpress_setting['lostpassword_url'] ) ? $loginpress_setting['lostpassword_url'] : 'off';
|
1650 |
|
1651 |
+
add_filter( 'gettext', array( $this, 'change_lostpassword_message' ), 20, 3 );
|
1652 |
add_filter( 'gettext', array( $this, 'change_username_label' ), 20, 3 );
|
1653 |
// add_filter( 'gettext', array( $this, 'change_password_label' ), 20, 3 );
|
1654 |
// Include CSS File in heared.
|
1664 |
if ( 'on' == $lostpassword_url ) {
|
1665 |
remove_filter( 'lostpassword_url', 'wc_lostpassword_url', 10 );
|
1666 |
}
|
1667 |
+
|
1668 |
+
/**
|
1669 |
+
* Filter for changing the lost password URL of lifter LMS plugin to default Lost Password URL of WordPress
|
1670 |
+
* By using this filter, you can prevent the redirection of lost password to Lifter LMS's lost password page over lost password link.
|
1671 |
+
*
|
1672 |
+
* @param bool
|
1673 |
+
*
|
1674 |
+
* @since 1.5.3
|
1675 |
+
*/
|
1676 |
+
if( apply_filters( 'loginpress_llms_lostpassword_url', false ) ) {
|
1677 |
+
remove_filter( 'lostpassword_url', 'llms_lostpassword_url', 10 );
|
1678 |
+
}
|
1679 |
}
|
1680 |
/**
|
1681 |
* Set Redirect Path of Logo
|
1682 |
*
|
1683 |
+
* @since 1.0.0
|
1684 |
+
* @version 1.5.3
|
1685 |
+
*
|
1686 |
* @return mixed
|
1687 |
* * * * * * * * * * * * * */
|
1688 |
public function login_page_logo_url() {
|
1689 |
|
1690 |
if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover'] ) ) {
|
1691 |
+
return __( $this->loginpress_key["customize_logo_hover"], 'loginpress' );
|
1692 |
} else {
|
1693 |
return home_url();
|
1694 |
}
|
1698 |
* Remove the filter login_errors from woocommerce login form.
|
1699 |
*
|
1700 |
* @since 1.0.16
|
1701 |
+
*
|
1702 |
* @return errors
|
1703 |
* * * * * * * * * * * * */
|
1704 |
function loginpress_woo_login_errors( $validation_error, $arg1, $arg2 ) {
|
1711 |
/**
|
1712 |
* Set hover Title of Logo
|
1713 |
*
|
1714 |
+
* @since 1.0.0
|
1715 |
+
* @version 1.5.3
|
1716 |
+
*
|
1717 |
* @return mixed
|
1718 |
* * * * * * * * * * * * */
|
1719 |
public function login_page_logo_title() {
|
1720 |
|
1721 |
if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover_title', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover_title'] ) ) {
|
1722 |
+
return __( $this->loginpress_key["customize_logo_hover_title"], 'loginpress' );
|
1723 |
} else {
|
1724 |
return home_url();
|
1725 |
}
|
1731 |
* @param $error
|
1732 |
* @since 1.0.0
|
1733 |
* @version 1.2.5
|
1734 |
+
|
1735 |
* @return string
|
1736 |
* * * * * * * * * * * * * * * * */
|
1737 |
public function login_error_messages($error) {
|
1793 |
* @param $text
|
1794 |
* @since 1.0.0
|
1795 |
* @version 1.0.21
|
1796 |
+
|
1797 |
* @return mixed
|
1798 |
* * * * * * * * * * * * * * * * * * */
|
1799 |
public function change_lostpassword_message( $translated_text, $text, $domain ) {
|
1800 |
|
1801 |
if ( is_array( $this->loginpress_key ) && array_key_exists( 'login_footer_text', $this->loginpress_key ) && $text == 'Lost your password?' && 'default' == $domain && trim( $this->loginpress_key['login_footer_text'] ) ) {
|
1802 |
|
1803 |
+
return trim( __( $this->loginpress_key['login_footer_text'], 'logipress' ) );
|
1804 |
}
|
1805 |
|
1806 |
return $translated_text;
|
1810 |
* @param [type] $translated_text [description]
|
1811 |
* @param [type] $text [description]
|
1812 |
* @param [type] $domain [description]
|
|
|
1813 |
* @since 1.1.3
|
1814 |
* @version 1.1.7
|
1815 |
+
*
|
1816 |
+
* @return string
|
1817 |
+
*
|
1818 |
*/
|
1819 |
public function change_username_label( $translated_text, $text, $domain ){
|
1820 |
|
1832 |
return $translated_text;
|
1833 |
}
|
1834 |
|
1835 |
+
// If options exist, then translate away.
|
1836 |
if ( $loginpress_setting && $default === $text ) {
|
1837 |
|
1838 |
// Check if the option exists.
|
1839 |
+
if ( '' != $login_order && 'default' != $login_order ) {
|
1840 |
if ( 'username' == $login_order ) {
|
1841 |
$label = __( 'Username', 'loginpress' );
|
1842 |
} elseif ( 'email' == $login_order ) {
|
1843 |
$label = __( 'Email Address', 'loginpress' );
|
1844 |
} else {
|
1845 |
+
$label = __( 'Username or Email Address', 'loginpress' );
|
1846 |
}
|
1847 |
+
$translated_text = esc_html( $label );
|
1848 |
} else {
|
1849 |
return $translated_text;
|
1850 |
}
|
1852 |
}
|
1853 |
return $translated_text;
|
1854 |
}
|
1855 |
+
/**
|
1856 |
+
* Change Password Label from Form.
|
1857 |
+
* @param [type] $translated_text [description]
|
1858 |
+
* @param [type] $text [description]
|
1859 |
+
* @param [type] $domain [description]
|
1860 |
+
* @since 1.1.3
|
1861 |
+
*
|
1862 |
+
* @return string
|
1863 |
+
*
|
1864 |
+
*/
|
1865 |
+
public function change_password_label( $translated_text, $text, $domain ) {
|
1866 |
+
|
1867 |
+
if ( $this->loginpress_key ) {
|
1868 |
+
$default = 'Password';
|
1869 |
+
$options = $this->loginpress_key;
|
1870 |
+
$label = array_key_exists( 'form_password_label', $options ) ? $options['form_password_label'] : '';
|
1871 |
+
|
1872 |
+
// If the option does not exist, return the text unchanged.
|
1873 |
+
if ( ! $options && $default === $text ) {
|
1874 |
+
return $translated_text;
|
1875 |
+
}
|
1876 |
+
|
1877 |
+
// If options exsit, then translate away.
|
1878 |
+
if ( $options && $default === $text ) {
|
1879 |
+
|
1880 |
+
// Check if the option exists.
|
1881 |
+
if ( array_key_exists( 'form_password_label', $options ) ) {
|
1882 |
+
$translated_text = esc_html( $label );
|
1883 |
+
} else {
|
1884 |
+
return $translated_text;
|
1885 |
+
}
|
1886 |
+
}
|
1887 |
}
|
1888 |
+
return $translated_text;
|
1889 |
+
}
|
1890 |
|
1891 |
/**
|
1892 |
* Manage Welcome Messages
|
1893 |
*
|
1894 |
* @param $message
|
1895 |
* @since 1.0.0
|
1896 |
+
* @version 1.5.3
|
1897 |
+
|
1898 |
* @return string
|
1899 |
* * * * * * * * * * * * */
|
1900 |
public function change_welcome_message($message) {
|
1906 |
|
1907 |
if ( array_key_exists( 'logout_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['logout_message'] ) ) {
|
1908 |
|
1909 |
+
$loginpress_message = __( $this->loginpress_key['logout_message'], 'loginpress' );
|
1910 |
}
|
1911 |
}
|
1912 |
|
1915 |
|
1916 |
if ( array_key_exists( 'lostpwd_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['lostpwd_welcome_message'] ) ) {
|
1917 |
|
1918 |
+
$loginpress_message = __( $this->loginpress_key['lostpwd_welcome_message'], 'loginpress' );
|
1919 |
}
|
1920 |
}
|
1921 |
|
1923 |
|
1924 |
if ( array_key_exists( 'register_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['register_welcome_message'] ) ) {
|
1925 |
|
1926 |
+
$loginpress_message = __( $this->loginpress_key['register_welcome_message'], 'loginpress' );
|
1927 |
}
|
1928 |
}
|
1929 |
|
1948 |
else {
|
1949 |
if ( array_key_exists( 'welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['welcome_message'] ) ) {
|
1950 |
|
1951 |
+
$loginpress_message = __( $this->loginpress_key['welcome_message'], 'loginpress' );
|
1952 |
}
|
1953 |
}
|
1954 |
|
|
|
1955 |
return ! empty( $loginpress_message ) ? "<p class='custom-message'>" . $loginpress_message. "</p>" : $message;
|
1956 |
}
|
1957 |
}
|
1959 |
/**
|
1960 |
* Set WordPress login page title.
|
1961 |
*
|
1962 |
+
* @since 1.4.6
|
1963 |
+
* @version 1.5.3
|
1964 |
+
|
1965 |
* @return string
|
1966 |
* * * * * * * * * * * * * * * * */
|
1967 |
public function login_page_title( $title ) {
|
1968 |
|
1969 |
if ( $this->loginpress_key && array_key_exists( 'customize_login_page_title', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_login_page_title'] ) ) {
|
1970 |
+
return __( $this->loginpress_key["customize_login_page_title"], 'loginpress' );
|
1971 |
} else {
|
1972 |
+
return $title;
|
1973 |
}
|
1974 |
}
|
1975 |
|
1985 |
|
1986 |
if ( is_multisite() ) { // if subdirectories are used in multisite.
|
1987 |
|
1988 |
+
$loginpress_obj = new LoginPress();
|
1989 |
$loginpress_page = $loginpress_obj->get_loginpress_page();
|
1990 |
|
1991 |
+
$page = get_permalink( $loginpress_page );
|
1992 |
|
1993 |
+
// Generate the redirect url.
|
1994 |
+
$url = add_query_arg(
|
1995 |
+
array(
|
1996 |
+
'autofocus[panel]' => 'loginpress_panel',
|
1997 |
+
'url' => rawurlencode( $page ),
|
1998 |
+
),
|
1999 |
+
admin_url( 'customize.php' )
|
2000 |
+
);
|
2001 |
|
2002 |
+
wp_safe_redirect( $url );
|
2003 |
|
2004 |
} else {
|
2005 |
|
2006 |
+
wp_redirect( get_admin_url() . "customize.php?url=" . wp_login_url() . '&autofocus=loginpress_panel' );
|
2007 |
}
|
2008 |
}
|
2009 |
}
|
js/customizer-previewer.js
CHANGED
@@ -1,169 +1,171 @@
|
|
1 |
/**
|
2 |
* Customizer Previewer
|
3 |
* @since 1.0.23
|
|
|
4 |
*/
|
5 |
-
(
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
}
|
|
1 |
/**
|
2 |
* Customizer Previewer
|
3 |
* @since 1.0.23
|
4 |
+
* @varsion 1.5.3
|
5 |
*/
|
6 |
+
(function(wp, $) {
|
7 |
+
"use strict";
|
8 |
+
|
9 |
+
// Bail if the customizer isn't initialized
|
10 |
+
if (!wp || !wp.customize) {
|
11 |
+
return;
|
12 |
+
}
|
13 |
+
|
14 |
+
var api = wp.customize,
|
15 |
+
OldPreview;
|
16 |
+
|
17 |
+
// Custom Customizer Preview class (attached to the Customize API)
|
18 |
+
api.myCustomizerPreview = {
|
19 |
+
// Init
|
20 |
+
init: function() {
|
21 |
+
|
22 |
+
var $body = $('body'),
|
23 |
+
$body_bg = $('#login h1'),
|
24 |
+
$form = $('#login form'),
|
25 |
+
$button = $('#login .submit'),
|
26 |
+
$nav = $('#nav a:first-child'),
|
27 |
+
$document = $(document); // Store references to the body and document elements
|
28 |
+
|
29 |
+
// Append our button to the <body> element
|
30 |
+
if ($('.login-action-login').length > 0) {
|
31 |
+
$('#loginform #user_login').on('focus', function() {
|
32 |
+
$('.login h1 a').attr('data-state', 'uifocus');
|
33 |
+
$('.login h1 a').addClass('watchdown');
|
34 |
+
});
|
35 |
+
$('#loginform #user_login').on('blur', function() {
|
36 |
+
$('.login h1 a').attr('data-state', 'uiblur');
|
37 |
+
$('.login h1 a').removeClass('watchdown').addClass('watchup');
|
38 |
+
setTimeout(function() {
|
39 |
+
$('.login h1 a').removeClass('watchup');
|
40 |
+
}, 800);
|
41 |
+
});
|
42 |
+
$('#loginform #user_pass').on('focus', function() {
|
43 |
+
$('.login h1 a').attr('data-state', 'pwfocus');
|
44 |
+
setTimeout(function() {
|
45 |
+
$('.login h1 a').addClass('yeti-hide');
|
46 |
+
}, 800);
|
47 |
+
});
|
48 |
+
$('#loginform #user_pass').on('blur', function() {
|
49 |
+
$('.login h1 a').attr('data-state', 'pwblur');
|
50 |
+
$('.login h1 a').removeClass('yeti-hide').addClass('yeti-seak');
|
51 |
+
setTimeout(function() {
|
52 |
+
$('.login h1 a').removeClass('yeti-seak');
|
53 |
+
}, 800);
|
54 |
+
});
|
55 |
+
}
|
56 |
+
if ($('.login-action-login').length > 0) { // If .login-action-login exist
|
57 |
+
|
58 |
+
$body_bg.append('<span class="loginpress-logo-partial loginpress-partial customize-partial-edit-shortcut" data-title="Change Logo"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="customize_logo_section"><span class="dashicons dashicons-edit"></span></button></span>');
|
59 |
+
|
60 |
+
$body.append('<span class="loginpress-presets-partial loginpress-partial customize-partial-edit-shortcut" data-title="Change Template"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="customize_presets"><span class="dashicons dashicons-admin-appearance"></span></button></span>');
|
61 |
+
|
62 |
+
$body.append('<span class="loginpress-background-partial loginpress-partial customize-partial-edit-shortcut" data-title="Change Background"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="section_background"><span class="dashicons dashicons-images-alt"></span></button></span>');
|
63 |
+
|
64 |
+
$body.append('<span class="loginpress-footer-partial loginpress-partial customize-partial-edit-shortcut" data-title="Change Footer"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="section_fotter"><span class="dashicons dashicons-edit"></span></button></span>');
|
65 |
+
|
66 |
+
$button.append('<span class="loginpress-button-partial loginpress-partial customize-partial-edit-shortcut" data-title="Customize Button"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="section_button"><span class="dashicons dashicons-edit"></span></button></span>');
|
67 |
+
|
68 |
+
$('<span class="loginpress-nav-partial loginpress-partial customize-partial-edit-shortcut" data-title="Customize Navigation"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="section_fotter"><span class="dashicons dashicons-edit"></span></button></span>').insertAfter($nav);
|
69 |
+
|
70 |
+
$form.append('<span class="loginpress-input-partial loginpress-partial customize-partial-edit-shortcut" data-title="Customize Form"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="section_form"><span class="dashicons dashicons-edit"></span></button></span>');
|
71 |
+
}
|
72 |
+
|
73 |
+
// $form.append( '<span class="loginpress-form-partial loginpress-partial customize-partial-edit-shortcut"><button class="loginpress-event-button customize-partial-edit-shortcut-button" data-customizer-event="section_form"><span class="dashicons dashicons-edit"></span></button></span>' );
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Listen for events on the LoginPress previewer button
|
77 |
+
*/
|
78 |
+
$document.on('touch click', '.loginpress-partial.customize-partial-edit-shortcut', function(e) {
|
79 |
+
|
80 |
+
var $el = $(this),
|
81 |
+
$event = $el.children().data('customizer-event'),
|
82 |
+
$title = ' .accordion-section-title',
|
83 |
+
$panel = '#accordion-panel-loginpress_panel' + $title,
|
84 |
+
$section = '#accordion-section-' + $event + $title,
|
85 |
+
$customizer = parent.document;
|
86 |
+
|
87 |
+
if (!$el.hasClass("active")) {
|
88 |
+
|
89 |
+
$($panel, $customizer).trigger('click');
|
90 |
+
$($section, $customizer).trigger('click');
|
91 |
+
}
|
92 |
+
|
93 |
+
$('.loginpress-partial.customize-partial-edit-shortcut').removeClass('active');
|
94 |
+
if ($el.hasClass('loginpress-footer-partial')) {
|
95 |
+
$('.loginpress-nav-partial').addClass('active');
|
96 |
+
}
|
97 |
+
if ($el.hasClass('loginpress-nav-partial')) {
|
98 |
+
$('.loginpress-footer-partial').addClass('active');
|
99 |
+
}
|
100 |
+
$el.addClass('active');
|
101 |
+
});
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Prevent logo link for customizer
|
105 |
+
*/
|
106 |
+
$document.on('click touch', '.login h1 a', function(e) {
|
107 |
+
e.preventDefault();
|
108 |
+
});
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Prevent Submit Button for customizer
|
112 |
+
*/
|
113 |
+
$document.on('click touch', '.submit, #backtoblog a', function(e) {
|
114 |
+
e.preventDefault();
|
115 |
+
});
|
116 |
+
/**
|
117 |
+
* Add spans to labels
|
118 |
+
*/
|
119 |
+
$(window).on('load', function() {
|
120 |
+
$('label').each(function() {
|
121 |
+
// console.log($(this).html());
|
122 |
+
var headerClone = $(this).clone();
|
123 |
+
$(headerClone).find('br').remove();
|
124 |
+
$(headerClone).find('input').remove();
|
125 |
+
var currentText = $(headerClone).html().replace(/(\r\n|\n|\r|\t)/gm, "");
|
126 |
+
|
127 |
+
var newHtml = $(this).html().replace(currentText, "<span>" + currentText + "</span>");
|
128 |
+
$(this).html(newHtml);
|
129 |
+
});
|
130 |
+
});
|
131 |
+
|
132 |
+
|
133 |
+
/* remove border around all input elements */
|
134 |
+
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
|
135 |
+
$(window).on('load', function() {
|
136 |
+
$('input:-webkit-autofill').each(function() {
|
137 |
+
// console.log($(this).length);
|
138 |
+
var text = $(this).val();
|
139 |
+
var sText = text.substring(text.length - 1, text.length);
|
140 |
+
var id = $(this).attr('id');
|
141 |
+
$(this).after(this.outerHTML).remove();
|
142 |
+
$('input[id=' + id + ']').val(text.slice(0, -1));
|
143 |
+
setTimeout(function() {
|
144 |
+
$('input[id=' + id + ']').val(text.slice(0, -1) + sText);
|
145 |
+
}, 1000)
|
146 |
+
});
|
147 |
+
});
|
148 |
+
}
|
149 |
+
}
|
150 |
+
};
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Capture the instance of the Preview since it is private (this has changed in WordPress 4.0)
|
154 |
+
*/
|
155 |
+
OldPreview = api.Preview;
|
156 |
+
api.Preview = OldPreview.extend({
|
157 |
+
initialize: function(params, options) {
|
158 |
+
// Store a reference to the Preview
|
159 |
+
api.myCustomizerPreview.preview = this;
|
160 |
+
|
161 |
+
// Call the old Preview's initialize function
|
162 |
+
OldPreview.prototype.initialize.call(this, params, options);
|
163 |
+
}
|
164 |
+
});
|
165 |
+
|
166 |
+
// Document ready
|
167 |
+
$(function() {
|
168 |
+
// Initialize our Preview
|
169 |
+
api.myCustomizerPreview.init();
|
170 |
+
});
|
171 |
+
})(window.wp, jQuery);
|
loginpress.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: LoginPress - Customizing the WordPress Login
|
4 |
* Plugin URI: https://WPBrigade.com/wordpress/plugins/loginpress/
|
5 |
* Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
|
6 |
-
* Version: 1.5.
|
7 |
* Author: WPBrigade
|
8 |
* Author URI: https://WPBrigade.com/
|
9 |
* Text Domain: loginpress
|
@@ -22,7 +22,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
22 |
/**
|
23 |
* @var string
|
24 |
*/
|
25 |
-
public $version = '1.5.
|
26 |
|
27 |
/**
|
28 |
* @var The single instance of the class
|
3 |
* Plugin Name: LoginPress - Customizing the WordPress Login
|
4 |
* Plugin URI: https://WPBrigade.com/wordpress/plugins/loginpress/
|
5 |
* Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
|
6 |
+
* Version: 1.5.3
|
7 |
* Author: WPBrigade
|
8 |
* Author URI: https://WPBrigade.com/
|
9 |
* Text Domain: loginpress
|
22 |
/**
|
23 |
* @var string
|
24 |
*/
|
25 |
+
public $version = '1.5.3';
|
26 |
|
27 |
/**
|
28 |
* @var The single instance of the class
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tested up to: 5.7
|
|
4 |
Contributors: WPBrigade, hiddenpearls, AbdulWahab610
|
5 |
Author URI: https://wpbrigade.com/?utm_source=loginpress-lite&utm_medium=author-url-link
|
6 |
Tags: wp-login, login, login customizer, custom login, wordpress login,
|
7 |
-
Stable tag: 1.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -217,6 +217,11 @@ Please visit <a target="_blank" rel="friend" href="https://WPBrigade.com/wordpre
|
|
217 |
|
218 |
== Changelog ==
|
219 |
|
|
|
|
|
|
|
|
|
|
|
220 |
= 1.5.2 – 2021-04-08 =
|
221 |
* Bugfix: Console error in customizer.
|
222 |
* Bugfix: Optimized plugin speed and code improvement.
|
@@ -589,5 +594,5 @@ Please visit <a target="_blank" rel="friend" href="https://WPBrigade.com/wordpre
|
|
589 |
|
590 |
== Upgrade Notice ==
|
591 |
|
592 |
-
= 1.5.
|
593 |
* Important Release, upgrade immediately. Compatible with 5.7
|
4 |
Contributors: WPBrigade, hiddenpearls, AbdulWahab610
|
5 |
Author URI: https://wpbrigade.com/?utm_source=loginpress-lite&utm_medium=author-url-link
|
6 |
Tags: wp-login, login, login customizer, custom login, wordpress login,
|
7 |
+
Stable tag: 1.5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
217 |
|
218 |
== Changelog ==
|
219 |
|
220 |
+
= 1.5.3 – 2021-05-18 =
|
221 |
+
* Bugfix: Remove depreciative method jQuery.fn.load().
|
222 |
+
* Enhancement: Translations added for custom login messages.
|
223 |
+
* Enhancement: Added a filter `loginpress_llms_lostpassword_url` to prevent the redirection of lost password to Lifter LMS's lost password page.
|
224 |
+
|
225 |
= 1.5.2 – 2021-04-08 =
|
226 |
* Bugfix: Console error in customizer.
|
227 |
* Bugfix: Optimized plugin speed and code improvement.
|
594 |
|
595 |
== Upgrade Notice ==
|
596 |
|
597 |
+
= 1.5.3 =
|
598 |
* Important Release, upgrade immediately. Compatible with 5.7
|