GraphicRiver

PHP issue - define

4099 posts
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Venezuela
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor moderator says

Hey guys I’m trying to achieve this with my WordPress admin panel, I know this is silly :(

https://gist.github.com/bad96f6e26c60ee37255

I tried echo, I tried single and doble quotes and I don’t know what the hell is going on.

Any php guru around here?

1012 posts
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Egypt
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
+1 more
wizylabs says

I dont really see anything wrong with your code but first of all make sure you added the ivor_contact_email option using update_option or add_option functions by WordPress and the below should definitely work

$email = get_option('ivor_contact_email');
define( "WEBMASTER_EMAIL", $email  );
2312 posts
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Europe
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 100 and 199 users
+1 more
CreativeMilk says

the $email in the define must be in ” “

1012 posts
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Egypt
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
+1 more
wizylabs says
the $email in the define must be in ” ”

I dont think that its necessary to have it in double quotes

750 posts
  • Author had a Free File of the Month
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 10 000 and 50 000 dollars
AdamGold says
the $email in the define must be in ” ”
I dont think that its necessary to have it in double quotes

definitely right.

Ivor, you just need to remove the double quotes from the email variable..

$email = get_option('ivor_contact_email'); define( "WEBMASTER_EMAIL", $email );
4099 posts
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Venezuela
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor moderator says

I tried with single quotes, doble quotes and without quotes, maybe it have something to do with update_option as wisylabs said.

4099 posts
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Venezuela
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor moderator says

This is the whole file guys – https://gist.github.com/88559af15e45cfa33b5d contact-form.php

1012 posts
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Egypt
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
+1 more
wizylabs says

Ivor, is there anywhere in your theme the option ivor_contact_email is inserted into the database? like somewhere in your theme options that adds the ivor_contact_email option on the form submit ?

using update_option('ivor_contact_email', 'example@example.com'); or add_option('ivor_contact_email', 'example@example.com');

193 posts
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 1 and 100 dollars
Kontent says

Is this for getting the WordPress admin email?

4099 posts
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Venezuela
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor moderator says
Ivor, is there anywhere in your theme the option ivor_contact_email is inserted into the database? like somewhere in your theme options that adds the ivor_contact_email option on the form submit ? using update_option('ivor_contact_email', 'example@example.com'); or add_option('ivor_contact_email', 'example@example.com');
I’m adding the email via the admin panel :)
$options[] = array(    "name" => "Contact Email",
        "desc" => "Enter your email for the contact page (i.e. example[at]email.com)",
        "id" => $shortname."_contact_email",
        "std" => "",
        "type" => "text");    
by
by
by
by
by