Contact Form 7, Modify submit button with PHP, Sage 9

Just leaving this here as someone else might find this useful, I needed to add a font awesome icon into the submit buttons on my contact 7 forms.

This theme was made using Sage Roots 9.

If you use a filter like the following within your -> App -> filters.php file it will let you mod the PHP somewhat. See Below:

add_action('init', function () {
    \wpcf7_add_form_tag('submit', function ($tag) {
        $tag = new \WPCF7_FormTag($tag);

        $class = \wpcf7_form_controls_class($tag->type);

        $atts = array();

        $atts['class'] = $tag->get_class_option($class);
        $atts['id'] = $tag->get_option('id', 'id', true);
        $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);

        $value = isset($tag->values[0]) ? $tag->values[0] : '';

        if (empty($value))
            $value = __('Test', 'wpcf7');

        $atts['class'] = 'button';
        $atts['type'] = 'submit';
        $atts['value'] = $value;

        $atts = \wpcf7_format_atts($atts);

        $html = sprintf('', $atts, $value);

        return $html;
}, 5);

Install WordPress with composer

This website was deployed using a hand full of files and composer.

These files were pushed to the Buddy VCS and using its pipeline features those few files were uploaded to this server via SFTP.

Buddy then connected using SSH and executed the command:

compser install

This installed WordPress thanks a package from: John P. Bloch


Composer also installs some themes and plugins, this is a copy of my composer.json file at the time of writing this short post.

  "repositories": [
      "type": "composer",
      "url": ""
  "require": {
    "php": ">=5.4",
    "composer/installers": "1.*",
    "johnpbloch/wordpress": "^4.8",
  "extra": {
    "wordpress-install-dir": "wp",
    "installer-paths": {
      "content/mu-plugins/{$name}/": [
      "content/plugins/{$name}/": [
      "content/themes/{$name}/": [

This also defines the WordPress install folder as wp and the wp-content folder as content for my theme and plugins installed using wpackagist.

If you don’t include a theme such as twenty seventeen as I have here then your install will load blank.

If you are interested in doing this you will require a few files like an index.php to call wordpress and a wp-config.php for the config as well as defining an env-config.php file for the database connection.

You can find these in a repo I have created on github to show the files needed.

This was just a quick post for the first post on my blog for some content I will go more in depth with detail in future posts.