Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#34208 closed defect (bug) (invalid)

is_rtl() does not work in Plugin with own Themes

Reported by: appfix-de's profile AppFIX-DE Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3.1
Component: Plugins Keywords:
Focuses: rtl Cc:

Description

RTL support in themes is achieved through the creation of an rtl.css file, which is loaded (if it exists) in the wp-includes/theme.php change "if ( is_rtl() )" to "if ( function_exists( 'is_rtl' ) && is_rtl() )".

Thank you.

Change History (11)

#1 follow-up: @mark-k
10 years ago

@AppFIX-DE, Why is it needed? is_rtl is part of core code and should always be there when theme and plugin code is being executed..

#2 in reply to: ↑ 1 @AppFIX-DE
10 years ago

Replying to mark-k:

@AppFIX-DE, Why is it needed? is_rtl is part of core code and should always be there when theme and plugin code is being executed..

yes is_rtl is part of core but we have use different theme for mobile and at here is_rtl function is not found in theme because its declared at wp-includes/locale.php and we couldn't include at our plugin

#3 follow-up: @ocean90
10 years ago

  • Keywords reporter-feedback added

Why is is_rtl() not available in your mobile theme? Can you provide some code to reproduce the issue?

#4 in reply to: ↑ 3 ; follow-up: @AppFIX-DE
10 years ago

Replying to ocean90:

Why is is_rtl() not available in your mobile theme? Can you provide some code to reproduce the issue?

Can you give mehr your email, then i can send you the plugin for the sample code. Then maybe you see the problem.

#5 @AppFIX-DE
10 years ago

@ocean90
@mark-k

In this Plugin you can use two themes at the same time. If you put domain.de it show Theme A and if you put domain.de/?system=app it show Theme B. And if i install the Plugin the Plugin is working but he can't find the function is_rtl() and i get a white screen in the backend.

If i change the wp-includes/theme.php "if ( is_rtl() )" to "if ( function_exists( 'is_rtl' ) && is_rtl() )" it's work.

I think it's a Bug from Wordpress side.

Last edited 10 years ago by AppFIX-DE (previous) (diff)

#6 in reply to: ↑ 4 ; follow-up: @ocean90
10 years ago

Replying to AppFIX-DE:

Can you give mehr your email, then i can send you the plugin for the sample code. Then maybe you see the problem.

dominikschilling at gmail dot com.

#7 in reply to: ↑ 6 @AppFIX-DE
10 years ago

Replying to ocean90:

Replying to AppFIX-DE:

Can you give mehr your email, then i can send you the plugin for the sample code. Then maybe you see the problem.

dominikschilling at gmail dot com.

I have send you the code to your email.

#8 follow-up: @ocean90
10 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

@AppFIX-DE: Please add add_editor_style() into a callback for the after_setup_theme hook.

function trac34208_after_setup_theme() {
    add_editor_style();
}
add_action( 'after_setup_theme', 'trac34208_after_setup_theme' );

#9 in reply to: ↑ 8 @AppFIX-DE
10 years ago

Replying to ocean90:

@AppFIX-DE: Please add add_editor_style() into a callback for the after_setup_theme hook.

function trac34208_after_setup_theme() {
    add_editor_style();
}
add_action( 'after_setup_theme', 'trac34208_after_setup_theme' );

Thanks for your help. I will check it.

#10 @AppFIX-DE
10 years ago

@ocean90: I have do that but it not work. Any other solution?

Last edited 10 years ago by AppFIX-DE (previous) (diff)

#11 @johnbillion
10 years ago

Please move this discussion to the support forums. Thanks!

Note: See TracTickets for help on using tickets.