From 9353219fe470c5880451a323e62870c515978748 Mon Sep 17 00:00:00 2001 From: avdata99 Date: Mon, 17 Oct 2022 13:06:10 -0300 Subject: [PATCH 1/6] Add twitter card --- header.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/header.php b/header.php index 17231e8..1f7d422 100644 --- a/header.php +++ b/header.php @@ -15,6 +15,37 @@ + + + + + + + + + + + + + + + > From 3969b62f9d3ce75d75e25f28d9fc55b074a0446e Mon Sep 17 00:00:00 2001 From: avdata99 Date: Wed, 19 Oct 2022 09:30:18 -0300 Subject: [PATCH 2/6] curly braces --- header.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/header.php b/header.php index 1f7d422..891fb3a 100644 --- a/header.php +++ b/header.php @@ -23,13 +23,13 @@ $twitter_title = get_the_title(); $twitter_desc = get_the_excerpt(); - if ( has_post_thumbnail() ) : + if ( has_post_thumbnail() ) { $twitter_thumb = get_the_post_thumbnail( $post, 'small' ); - elseif ( okfn_get_first_image_url_from_post_content() ) : + } elseif ( okfn_get_first_image_url_from_post_content() ) { $twitter_thumb = okfn_get_first_image_url_from_post_content(); - else : + } else { $twitter_thumb = null; - endif; + } $twitter_name = get_the_author_meta('twitter'); if (!$twitter_name) { $twitter_name = 'okfn'; } From 0bfb2afc9b70a50a5d308a60be34116d1c19b91e Mon Sep 17 00:00:00 2001 From: avdata99 Date: Wed, 19 Oct 2022 11:27:08 -0300 Subject: [PATCH 3/6] Test syntax errors --- .github/workflows/test-syntax.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/test-syntax.yaml diff --git a/.github/workflows/test-syntax.yaml b/.github/workflows/test-syntax.yaml new file mode 100644 index 0000000..5a3559f --- /dev/null +++ b/.github/workflows/test-syntax.yaml @@ -0,0 +1,30 @@ +name: Run tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + php: + name: Testing + runs-on: ubuntu-latest + env: + PHP_VERSION: '7.4' + + steps: + - name: Checkout the project + uses: actions/checkout@v3 + + - name: Setup the PHP ${{ env.PHP_VERSION }} environment on ${{ runner.os }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ env.PHP_VERSION }} + tools: phpcs, phpunit + extensions: imagick, mbstring + + - name: Searching for PHP syntax errors + run: find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l From 3bf94a1f6d7d773d880413d56985e75eb67b695a Mon Sep 17 00:00:00 2001 From: avdata99 Date: Wed, 19 Oct 2022 11:39:12 -0300 Subject: [PATCH 4/6] Fix syntax error --- header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/header.php b/header.php index 891fb3a..a35f955 100644 --- a/header.php +++ b/header.php @@ -43,7 +43,7 @@ - + From 9781662cf4f5676c8e4b721cc59541349eb99a7f Mon Sep 17 00:00:00 2001 From: avdata99 Date: Wed, 19 Oct 2022 12:41:40 -0300 Subject: [PATCH 5/6] Use the okfnwp_twitter_id theme option --- header.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/header.php b/header.php index a35f955..1ff5a9b 100644 --- a/header.php +++ b/header.php @@ -30,20 +30,29 @@ } else { $twitter_thumb = null; } - - $twitter_name = get_the_author_meta('twitter'); - if (!$twitter_name) { $twitter_name = 'okfn'; } + $okf_theme_options = get_option( 'theme_options_option_name' ); + if ( ! empty( $okf_theme_options['okfnwp_twitter_id'] ) ) { + $twitter_site = $okf_theme_options['okfnwp_twitter_id']; + } else { + $twitter_site = null; + } + $twitter_creator = get_the_author_meta('twitter'); ?> + + + + + + + - - - + From dd5de4de4e428db956eab39ea39f83b074454a92 Mon Sep 17 00:00:00 2001 From: avdata99 Date: Thu, 20 Oct 2022 08:43:01 -0300 Subject: [PATCH 6/6] add @ --- header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/header.php b/header.php index 1ff5a9b..7f9509d 100644 --- a/header.php +++ b/header.php @@ -47,10 +47,10 @@ - + - +