Coder Social home page Coder Social logo

araeubig / acf-rating-field Goto Github PK

View Code? Open in Web Editor NEW

This project forked from misaki-web/acf-rating-field

0.0 0.0 0.0 235 KB

Rating field for ACF supporting decimal numbers and custom symbol (default is star: ★)

License: GNU General Public License v3.0

PHP 89.86% CSS 10.14%

acf-rating-field's Introduction

ACF Rating Field

ACF Rating Field is a Wordpress plugin adding a new ACF field to manage ratings with decimal numbers. The default rating symbol is a star ("★") but it can be customised.

Here are examples for a rating of 3.6 out of 5:

Examples of how ACF Rating Field can be rendered for a rating of 3.6 out of 5

Installation

  • Download the latest version on GitHub.

  • Extract the archive and copy the folder (acf-rating-field) to the Wordpress plugins folder (/wp-content/plugins/).

  • Go to the Wordpress plugins manager on your website (your-website.ext/wp-admin/plugins.php) and enable the plugin ACF Rating Field. Note that you can enable auto-updates.

Usage

Admin

Go to the ACF administration page (your-website.ext/wp-admin/edit.php?post_type=acf-field-group), add a new field group and choose the field Rating:

Adding ACF Rating Field

Change the field settings as needed.

Front-end

To display the field value, the shortcode acf_rating_field can be used. By default, it'll look at custom fields for the current post where the shortcode is added. For example, the following shortcode:

[acf_rating_field name="FIELD_NAME"]

is the same as this one:

[acf_rating_field name="FIELD_NAME" type="post"]

Adding the ACF Rating Field shortcode

To get the field value from another post, use the attribute id:

[acf_rating_field name="FIELD_NAME" id="POST_ID"]

If the rating field is linked to a user, set the type user in the shortcode. By default, it'll look at custom fields for the current user:

[acf_rating_field name="FIELD_NAME" type="user"]

To specify a specific user, set the attribute id:

[acf_rating_field name="FIELD_NAME" type="user" id="USER_ID"]

License

ACF Rating Field: Rating field for ACF supporting decimal numbers and custom symbol
Copyright (C) 2022, 2024 Misaki F.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Third-party code

acf-rating-field's People

Contributors

misaki-web avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.