Forum Replies Created

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    I think I found the issue.

    There was a BBC: [your-email] in one of the other forms, and this is the form that was being targeted.

    I had overlooked this, but I’ve removed the BBC and its all good now.

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Our theme was custom developed around 2 years ago

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Here are my active plugins

    Advanced Custom Fields PRO
    Better Search Replace
    Contact Form 7
    Contact Form 7 Google Analytics Integration
    Geolocation IP Detection
    Google Analytics for WordPress by MonsterInsights
    Health Check & Troubleshooting
    Honeypot for Contact Form 7
    Lead info with country for Contact Form 7
    Max Mega Menu
    Really Simple CAPTCHA
    Really Simple SSL
    Redirection
    Simple History
    Smush Pro
    What The File
    WP Google Maps
    WP Mail SMTP
    WP Realtime Sitemap
    WPMU DEV Dashboard
    Yoast Duplicate Post
    Yoast SEO
    Yoast SEO Premium
    Yoast SEO: Video`

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Thanks @takayukister

    I’ve removed those codes from additional settings

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    I don’t think the additional settings are working properly right now, but here they are

    Link to screenshot of additional settings

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    @takayukister I’ve taken screenshots, and I’ve changed the email addresses as per your advice.

    Link to the screenshots on imgur

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Thanks for the tip @jdembowski

    I wasn’t aware of the spam filter rules. Here is the requested website:
    [ Again, the link field has been updated ]

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Here is the website: [ use the link field next time ]

    • This reply was modified 4 years, 3 months ago by Jan Dembowski.
    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Hmmm, I used to have the require_once(‘options.php’); outside of the function alongside the rest of the require_once commands. But this broke the site giving me this error:

    Fatal error: Call to undefined function wp_reset_vars() in C:\xampp\htdocs\wordpress\wp-admin\options.php on line 25

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    OK, getting ready to launch my theme!

    One pretty important note though…

    The function for getting defaults is located in funtions.php, so you have to include options.php in the of_get_default function.

    For example, this will render your WP install unusable

    require_once('options.php');
    function of_get_default( $option ) {
         $defaults = optionsframework_options();
         if ( isset( $defaults[$option]['std'] ) ) {
              return $defaults[$option]['std'];
         }
         return false; // default if no std is set
    }

    What you need to put is this:

    function of_get_default( $option ) {
         require_once('options.php');
         $defaults = optionsframework_options();
         if ( isset( $defaults[$option]['std'] ) ) {
              return $defaults[$option]['std'];
         }
         return false; // default if no std is set
    }

    Just worked this out and didn’t want anyone else to make the same mistake

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Ahhhh you are 1000% right Devin!

    I just noticed you are the author of options framework, and I totally should have read your blog posts first before any of this.

    Your method is way better and less hacky so I am for sure going to use it.

    This was the last issue I had with making my WordPress theme so I can release it now 🙂

    A huge thank you to you Devin, for both the framework and the help you’ve provided in this thread.

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Ok! I figured it out, I am not super great with PHP so it took a bit of time. Here is my function

    //Find which item in the array has a matching id value, then return the std (default) value
    require_once('options.php');
    function of_get_default( $option ) {
        $defaults = optionsframework_options();
        $result = 'default not set';
        for ($i = 0; $i <= count($defaults); $i++) {
            if($defaults[$i]['id'] === $option)
                {
                    $result = $defaults[$i]['std'];
                    break;
                }
        }
         return $result; // default if no std is set
    }

    Not super optimal but it works

    I kind of don’t like how this sort of thing is required though, I use frameworks not to get messy with code 😛

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    OK! I’ve figured some of it out…

    return $defaults[$option][‘std’];

    This will return a false, because $option is will only accept numbers, but it is being set as a string.

    So to get my social_media_editor std value I can write
    return $defaults[8][‘std’];

    I just need to write a script that will find what position my id values are in the array.

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Hmm yeah a dump of $defaults is what I would expect…

    Something along the lines of:
    array(17) { [0]=> array(2) { ["name"]=> string(19) "Front-Page Settings" ["type"]=> string(7) "heading" } [1]=> array(6) { ["name"]=> string(29) "Core Competency 1 Text Editor" ["desc"]=> string(184) "This should include a heading 3 and a short bit of text about one of your company's primary offerings. Let visitors know what you are good at and consider adding a Read More... link. " ["id"]=> string(10) "cc1_editor" ["std"]=> string(311)

    Yeah I’ll have to check whats up with that isset…

    Thank you so much for the help Devin!

    Thread Starter JonathanAlphonso

    (@jonathanalphonso)

    Ok! Getting closer,

    SO I’ve imported the options.php file in my fuctions.php file, so now I can access the function optionsframework_options

    My code is like this

    require_once('options.php');
    function of_get_default( $option ) {
         $defaults = optionsframework_options();
         if ( isset( $defaults[$option]['std'] ) ) {
              return $defaults[$option]['std'];
         }
         return 'false'; // default if no std is set
    }
    <?php echo of_get_option( 'social_media_editor', of_get_default('social_media_editor')); ?>

    This still returns a ‘false’ though

Viewing 15 replies - 1 through 15 (of 18 total)