Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-02-2010, 03:01 PM Wordpress Functions
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
I know this is probably a silly question but what does this piece of code do?

PHP Code:
    // Make theme available for translation
    // Translations can be filed in the /languages/ directory
    
load_theme_textdomain'twentyten'TEMPLATEPATH '/languages' );

    
$locale get_locale();
    
$locale_file TEMPLATEPATH "/languages/$locale.php";
    if ( 
is_readable$locale_file ) )
        require_once( 
$locale_file ); 
Im espeically looking at the if statement and what happens if its false or true?
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
 
Register now for full access!
Old 08-02-2010, 03:05 PM Re: Wordpress Functions
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
is_readable
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-02-2010, 03:07 PM Re: Wordpress Functions
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
yeah i know that but what does the if execute if its true or false?
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 08-02-2010, 03:09 PM Re: Wordpress Functions
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
If its false it doesn't do anything. If its true it executes the line:
PHP Code:
require_once( $locale_file ); 
Basically its checking if the file $locale_file is readable and including it if it is.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-02-2010, 03:29 PM Re: Wordpress Functions
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
ah cheers i wasn't sure how much it executed etc. Cheers!
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 08-02-2010, 03:34 PM Re: Wordpress Functions
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
just like any other IF statement

IF true [do something]
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-02-2010, 04:56 PM Re: Wordpress Functions
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
Yeah but it wasn't in { }.
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 08-02-2010, 09:39 PM Re: Wordpress Functions
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You only NEED to use brackets if the body of an if statement is more than one line:
PHP Code:
if($condition)
     
$foo 'bar';
else
     
$abc '123'
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to Wordpress Functions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55796 seconds with 12 queries